Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
simple test for unsigned requests
Browse files Browse the repository at this point in the history
  • Loading branch information
philhug committed Sep 10, 2015
1 parent 5859c47 commit 4addebf
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions authnrequest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func TestGetSignedRequest(t *testing.T) {
IDPSSODescriptorURL: "http://www.onelogin.net",
IDPPublicCertPath: "./default.crt",
AssertionConsumerServiceURL: "http://localhost:8000/auth/saml/name",
SPSignRequest: true,
}
err := sp.Init()
assert.NoError(err)
Expand All @@ -28,3 +29,21 @@ func TestGetSignedRequest(t *testing.T) {
err = VerifyRequestSignature(signedXML, sp.PublicCertPath)
assert.NoError(err)
}

func TestGetUnsignedRequest(t *testing.T) {
assert := assert.New(t)
sp := ServiceProviderSettings{
IDPSSOURL: "http://www.onelogin.net",
IDPSSODescriptorURL: "http://www.onelogin.net",
IDPPublicCertPath: "./default.crt",
AssertionConsumerServiceURL: "http://localhost:8000/auth/saml/name",
SPSignRequest: false,
}
err := sp.Init()
assert.NoError(err)

// Construct an AuthnRequest
authnRequest := sp.GetAuthnRequest()
assert.NoError(err)
assert.NotEmpty(authnRequest)
}

0 comments on commit 4addebf

Please sign in to comment.