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

Function specProfLogoutRequestForm

spec_profiles_test.go:559–578  ·  view source on GitHub ↗

specProfLogoutRequestForm returns the base64 HTTP-POST form value of a LogoutRequest from the IdP to e.sp, signed by the IdP if sign is set.

(t *testing.T, e *spcovEnv, sign bool, mutate func(*LogoutRequest))

Source from the content-addressed store, hash-verified

557// specProfLogoutRequestForm returns the base64 HTTP-POST form value of a
558// LogoutRequest from the IdP to e.sp, signed by the IdP if sign is set.
559func specProfLogoutRequestForm(t *testing.T, e *spcovEnv, sign bool, mutate func(*LogoutRequest)) string {
560 t.Helper()
561 req := &LogoutRequest{
562 ID: "id-idp-logout-request",
563 Version: "2.0",
564 IssueInstant: spcovNow,
565 Destination: e.sp.SloURL.String(),
566 Issuer: &Issuer{Value: spcovIDPEntityID},
567 NameID: &NameID{Value: "alice@example.com"},
568 SessionIndex: &SessionIndex{Value: "idx-1"},
569 }
570 if mutate != nil {
571 mutate(req)
572 }
573 el := req.Element()
574 if sign {
575 el = e.idpSign(t, el)
576 }
577 return base64.StdEncoding.EncodeToString(spcovSerialize(t, el))
578}
579
580// saml-profiles §4.4.4.1: "The requester MUST authenticate itself to the
581// responder and ensure message integrity" and the Issuer "MUST be present".

Calls 4

ElementMethod · 0.95
spcovSerializeFunction · 0.85
StringMethod · 0.80
idpSignMethod · 0.80

Tested by

no test coverage detected