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

HTTP-Redirect: Missing Signature and SigAlg parameters in SAMLRequest Url (AuthNRequest) #89

Open
seriouszyx opened this issue Dec 15, 2021 · 1 comment

Comments

@seriouszyx
Copy link

I'm using the latest gosaml2 and noticed that my identity provider (Keycloak) does not accept the signed AuthNRequest.

The reason is:

But it seems that the Redirect binding authUrl does not have SigAlg and Signature parameters, even though setting SignAuthnRequests to true and SPKeyStore to my own Keystore.

reference: spring-projects/spring-security#7711

@romaindutartre
Copy link

Hi, I've had the exact same issue and I've been able to generate the correct signature using this code:

if sp.SignAuthnRequests && sp.IdentityProviderSSOBinding == saml2.BindingHttpRedirect {
    var doc *etree.Document
    doc, err = sp.BuildAuthRequestDocument()

    if err != nil {
	return
    }

    url, err = sp.BuildAuthURLRedirect(callbackURL, doc)
} else {
    url, err = sp.BuildAuthURL(callbackURL)
}

@russellhaering Is this the intented way of using the library ? I thought that BuildAuthURL would have used something like this but it doesn't seem to be the case.

Regards,
Romain

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

No branches or pull requests

2 participants