Skip to content

omniauth not OOTB compatible with rack_csrf #1069

Closed

Description

@HoneyryderChuck

Please complete all sections.

Configuration

  • Provider Gem: omniauth-2.1.0

Expected Behavior

After upgrading omniauth to latest, this example script stopped working due to csrf verification failure, even after switching the CSRF backend to rack_csrf. After some investigation I found out that the problem came from the backend used for csrf token verification in rack-protection not being compatible with rack_csrf.

Actual Behavior

While it's probably unreasonable to expect rack-protection to change default settings which may cause other software to break, perhaps it should be on omniauth side to document somewhere how to patch the request_validation_phase callback, at least for the most used CSRF backend outside of rails (which requires another full gem just to set the callback).

Activity

  1. BobbyMcWho commented on May 10, 2022

    @BobbyMcWho
    Member

    If you'd like to add it to the wiki, it's open to contributions. While I do my best, I unfortunately can't account for every use case and framework, we try to be as framework agnostic as possible, so that's why Rails has a separate gem to help with setting it, since it's not entirely straightforward

  2. HoneyryderChuck commented on May 11, 2022

    @HoneyryderChuck
    ContributorAuthor

    I think I can add smth once I'm done with it on my side. Is the wiki open for editing from anyone? Or do I have to be part of the omniauth organisation?

  3. added a commit that references this issue on May 16, 2022
    7413f4f
  4. added theissue type on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions