MCPcopy Create free account
hub / github.com/crewjam/saml / signedRedirectSSORequest

Function signedRedirectSSORequest

xhtml_forms_test.go:182–197  ·  view source on GitHub ↗

signedRedirectSSORequest returns an HTTP-Redirect AuthnRequest to the IdP whose query string is signed, with the given Destination.

(t *testing.T, test *IdentityProviderTest, destination string)

Source from the content-addressed store, hash-verified

180// signedRedirectSSORequest returns an HTTP-Redirect AuthnRequest to the IdP
181// whose query string is signed, with the given Destination.
182func signedRedirectSSORequest(t *testing.T, test *IdentityProviderTest, destination string) *http.Request {
183 t.Helper()
184 test.SP.SignatureMethod = dsig.RSASHA256SignatureMethod
185 authnRequest, err := test.SP.MakeAuthenticationRequest(destination, HTTPRedirectBinding, HTTPPostBinding)
186 assert.NilError(t, err)
187 redirectURL, err := authnRequest.Redirect("ThisIsTheRelayState", &test.SP)
188 assert.NilError(t, err)
189 query := redirectURL.Query()
190 assert.Check(t, query.Get("SigAlg") != "")
191 assert.Check(t, query.Get("Signature") != "")
192
193 u := test.IDP.SSOURL
194 u.RawQuery = redirectURL.RawQuery
195 r, _ := http.NewRequest("GET", u.String(), nil)
196 return r
197}
198
199func TestIDPSignedAuthnRequestRequiresDestination(t *testing.T) {
200 t.Run("signed redirect without destination is rejected", func(t *testing.T) {

Calls 4

StringMethod · 0.80
GetMethod · 0.65
RedirectMethod · 0.45

Tested by

no test coverage detected