Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

artifact binding support #46

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

amdonov
Copy link

@amdonov amdonov commented Sep 3, 2018

Relates to #40

This integrates Artifact Binding support. I tried to make as few changes as possible. In my tests I was able to switch back and forth between post and artifact binding without issue.

I did have to write a different example client because Okta seems to always respond with a post binding response regardless of the request made. I didn't include my example in the commit because it involved having a working IdP setup and probably would be of limited use to others.

SP creation in it looks like the following:

sp := &saml2.SAMLServiceProvider{
IdentityProviderSSOURL: metadata.IDPSSODescriptor.SingleSignOnServices[0].Location,
IdentityProviderArtifactResolutionServiceURL: metadata.IDPSSODescriptor.ArtifactResolutionService.Location,
HTTPClient: client,
IdentityProviderIssuer: metadata.EntityID,
ServiceProviderIssuer: "http://example.com/saml/acs/example",
AssertionConsumerServiceURL: "http://localhost:8080/v1/_saml_callback",
SignAuthnRequests: true,
AudienceURI: "http://example.com/saml/acs/example",
IDPCertificateStore: &certStore,
SPKeyStore: keyStore,
RequestedBinding: saml2.BindingHttpArtifact,
}

IdentityProviderArtifactResolutionServiceURL, RequestedBinding, and HTTPClient are the new fields. None are required if clients want to stick with POST binding.

On an unrelated note, I had to change BuildAuthURL to call BuildAuthURLRedirect rather than BuildAuthURLFromDocument to get valid requests for my IdP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant