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

Function specProfAuthnRequest

spec_profiles_test.go:69–80  ·  view source on GitHub ↗

specProfAuthnRequest returns an IdpAuthnRequest for an AuthnRequest from test.SP with the given extra XML attributes on the AuthnRequest element.

(test *IdentityProviderTest, attrs string)

Source from the content-addressed store, hash-verified

67// specProfAuthnRequest returns an IdpAuthnRequest for an AuthnRequest from
68// test.SP with the given extra XML attributes on the AuthnRequest element.
69func specProfAuthnRequest(test *IdentityProviderTest, attrs string) *IdpAuthnRequest {
70 req := &IdpAuthnRequest{
71 Now: TimeNow(),
72 IDP: &test.IDP,
73 RequestBuffer: []byte(`<AuthnRequest xmlns="urn:oasis:names:tc:SAML:2.0:protocol" ` +
74 `ID="id-specprof-request" IssueInstant="2015-12-01T01:57:09Z" Version="2.0" ` + attrs + `>` +
75 `<Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">` + test.SP.MetadataURL.String() + `</Issuer>` +
76 `</AuthnRequest>`),
77 }
78 req.HTTPRequest = httptest.NewRequest(http.MethodPost, test.IDP.SSOURL.String(), nil)
79 return req
80}
81
82// specProfServeSPMetadata makes the IdP of test see md as the metadata of
83// test.SP.

Calls 1

StringMethod · 0.80

Tested by

no test coverage detected