(t *testing.T)
| 933 | } |
| 934 | |
| 935 | func TestSPCanProcessResponseWithoutDestination(t *testing.T) { |
| 936 | test := NewServiceProviderTest(t) |
| 937 | s := ServiceProvider{ |
| 938 | Key: test.Key, |
| 939 | Certificate: test.Certificate, |
| 940 | MetadataURL: mustParseURL("https://15661444.ngrok.io/saml2/metadata"), |
| 941 | AcsURL: mustParseURL("https://15661444.ngrok.io/saml2/acs"), |
| 942 | IDPMetadata: &EntityDescriptor{}, |
| 943 | } |
| 944 | err := xml.Unmarshal(test.IDPMetadata, &s.IDPMetadata) |
| 945 | assert.Check(t, err) |
| 946 | |
| 947 | req := http.Request{PostForm: url.Values{}} |
| 948 | test.replaceDestination("") |
| 949 | req.PostForm.Set("SAMLResponse", base64.StdEncoding.EncodeToString(test.SamlResponse)) |
| 950 | _, err = s.ParseResponse(&req, []string{"id-9e61753d64e928af5a7a341a97f420c9"}) |
| 951 | assert.Check(t, err) |
| 952 | } |
| 953 | |
| 954 | func (test *ServiceProviderTest) responseDom() (doc *etree.Document) { |
| 955 | doc = etree.NewDocument() |
nothing calls this directly
no test coverage detected