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))
| 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. |
| 559 | func 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". |
no test coverage detected