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

Use of origin parameter in request URL breaks integration with certain IDPs #201

Open
joshIsCoding opened this issue Jul 14, 2021 · 0 comments

Comments

@joshIsCoding
Copy link

Using the origin parameter as originally documented by OmniAuth causes an error when attempting to authenticate with some IDPs, specifically Google as an IDP via a custom SAML 2.0 app integration. Initiating the SAML request with a URL containing an origin param raises an invalid ticket error from the Ruby SAML gem.
So a request URL such as the following: https://test-app.com/auth/saml/2/callback?origin=something

Gives the following error on receipt of the SAML response from Google:

Authentication failure! invalid_ticket: OneLogin::RubySaml::ValidationError, The status code of the Response was not Success, was Requester => RequestDenied -> Invalid request, ACS Url in request `https://test-app.com/auth/saml/2/callback?origin=something` doesn't match configured ACS Url `https://test-app.com/auth/saml/2/callback`.

HTTP Origin header (https://accounts.google.com) didn't match request.base_url (https://test-app.com/)

Fortunately, a simple solution is to submit the parameter in the request body instead. I have created a pull request for the main OmniAuth gem to reflect that this is possible now that all authentication requests are supposed to use POST. I am flagging the issue here in case others end up searching for the problem, and also to offer to provide some origin parameter documentation in a pull request to this gem if you think it would be beneficial.

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

1 participant