(t *testing.T)
| 136 | } |
| 137 | |
| 138 | func TestXHTMLServiceProviderForms(t *testing.T) { |
| 139 | test := NewIdentityProviderTest(t, applyKey) |
| 140 | sp := &test.SP |
| 141 | |
| 142 | authnRequest, err := sp.MakeAuthenticationRequest(xhtmlAwkwardURL, HTTPPostBinding, HTTPPostBinding) |
| 143 | assert.NilError(t, err) |
| 144 | logoutRequest, err := sp.MakeLogoutRequest(xhtmlAwkwardURL, "alice") |
| 145 | assert.NilError(t, err) |
| 146 | logoutResponse, err := sp.MakeLogoutResponse(xhtmlAwkwardURL, "id-1234") |
| 147 | assert.NilError(t, err) |
| 148 | |
| 149 | for name, fragment := range map[string][]byte{ |
| 150 | "AuthnRequest": authnRequest.PostWithNonce(xhtmlAwkwardRelay, "n0nce"), |
| 151 | "LogoutRequest": logoutRequest.PostWithNonce(xhtmlAwkwardRelay, "n0nce"), |
| 152 | "LogoutResponse": logoutResponse.PostWithNonce(xhtmlAwkwardRelay, ""), |
| 153 | } { |
| 154 | t.Run(name, func(t *testing.T) { |
| 155 | assertXHTMLDocument(t, wrapXHTML(fragment)) |
| 156 | }) |
| 157 | } |
| 158 | |
| 159 | for name, tmpl := range map[string]interface { |
| 160 | Execute(io.Writer, any) error |
| 161 | }{ |
| 162 | "SimpleSign request": simpleSignRequestFormTemplate, |
| 163 | "SimpleSign response": simpleSignResponseFormTemplate, |
| 164 | } { |
| 165 | t.Run(name, func(t *testing.T) { |
| 166 | var buf bytes.Buffer |
| 167 | assert.NilError(t, tmpl.Execute(&buf, simpleSignFormData{ |
| 168 | URL: xhtmlAwkwardURL, |
| 169 | Message: "PHNhbWxwOlJlc3BvbnNlLz4+/w==", |
| 170 | RelayState: xhtmlAwkwardRelay, |
| 171 | SigAlg: dsig.RSASHA256SignatureMethod, |
| 172 | Signature: "c2lnbmF0dXJl+/w==", |
| 173 | Nonce: "n0nce", |
| 174 | })) |
| 175 | assertXHTMLDocument(t, wrapXHTML(buf.Bytes())) |
| 176 | }) |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | // signedRedirectSSORequest returns an HTTP-Redirect AuthnRequest to the IdP |
| 181 | // whose query string is signed, with the given Destination. |
nothing calls this directly
no test coverage detected