Skip to content

docs: Add CSRF protection section - #1075

Merged
sferik merged 2 commits into
omniauth:masterfrom
masterT:master
Oct 17, 2026
Merged

sferik merged 2 commits into
omniauth:masterfrom
masterT:master

Conversation

@masterT

@masterT masterT commented Jun 10, 2022

Copy link
Copy Markdown
Contributor

Add a generic section about CSRF protection, to describe how it's implemented in OmniAuth and how to configure it.

References:

@masterT

masterT commented Jun 18, 2022 •

Copy link
Copy Markdown
Contributor Author

This took me so much time to figure out the CSRF mechanism, I figured I might not be the only one so it could help this section.

@BobbyMcWho

Copy link
Copy Markdown
Member

There are some grammar changes and misspellings that I need to resolve before merge, I will get to them when I have some time

@masterT

masterT commented Jun 24, 2022

Copy link
Copy Markdown
Contributor Author

@BobbyMcWho I made some changes. Feel free to edit the wording and fix the grammar/spelling mistake, English is not my native language.

Comment thread README.md Resolved
Comment thread README.md Resolved
@olleolleolle

Copy link
Copy Markdown

Thanks for including this in the README documentation, it makes it more approachable!

@mpvosseller

Copy link
Copy Markdown

Not sure if it should be part of this PR but README.md still says the omniauth-rails_csrf_protection gem is needed for CSRF protection in Rails in the "Rails (without Devise)" section despite comments in that gem's repo which suggest it isn't needed anymore.

If that's true should / can the readme be updated to reflect that?

Screenshot 2025-11-19 at 4 56 49 PM

masterT and others added 2 commits October 17, 2026 10:15
Describe how OmniAuth protects the request phase against CSRF and how
to configure OmniAuth::AuthenticityTokenProtection.
Fix grammar, keep the rack_csrf example's context, point Rails users
to the Rails setup section, and explain the Rails CSRF setting there.

@sferik sferik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for writing this up, and sorry it took so long! I combined your commits, fixed the grammar, and tied the section to the new Rails setup from #1151.

@sferik
sferik merged commit 1583106 into omniauth:master Oct 17, 2026
54 of 55 checks passed
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.

5 participants