Repository navigation
Conversation
This is related to omniauth#809 and related discussions around CVE-2015-9284. `OmniAuth::AuthenticityCheck` is available to hook into `rack-protection` (provided that gem is available), and will reject requests that do not come with a CSRF token that matches what's stored in the session. This is useful in non-Rails applications (whereas otherwise people are better served using the `omniauth-rails_csrf_protection` gem). To enable this approach, you will need to set up the `before_request_phase` hook: `OmniAuth.config.before_request_phase = OmniAuth::AuthenticityCheck.new` - and then ensure your session's `csrf` token is passed through in each POST request to `/auth/:provider`, as per the documentation in `rack-protection`: https://github.com/sinatra/sinatra/blob/master/rack-protection/lib/rack/protection/authenticity_token.rb.
Member
|
closed via #1010 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is related to #809 and related discussions around CVE-2015-9284.
OmniAuth::AuthenticityCheckis available to hook intorack-protection(provided that gem is available), and will reject requests that do not come with a CSRF token that matches what's stored in the session. This is useful only in non-Rails applications (whereas otherwise people are better served using theomniauth-rails_csrf_protectiongem).To enable this approach, you will need to set up the
before_request_phasehook:… and then ensure your session's
csrftoken is passed through in each POST request to/auth/:provider, as per the documentation inrack-protection.