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

Lack of CSRF token w/ Rails4 #57

Open
sanemat opened this Issue Jun 15, 2013 · 1 comment

Comments

Projects
None yet
1 participant
@sanemat

sanemat commented Jun 15, 2013

When redirect to /auth/:provider/callback, omniauth-identity does not have CSRF token. This brings 2 problems.

  • CSRF risk.
  • No persist session, like authentication data and session[:user_id], because no CSRF token causes no authentication token.

Below is related issue, and this is very rails-specific code, I also think.
Adding authenticity token so session will persist

With:
omniauth-identity v1.1.0, rails v4.1(perhaps above v4.0)

@sanemat

This comment has been minimized.

Show comment
Hide comment
@sanemat

sanemat Jun 15, 2013

My work around solution:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :identity,
    on_login: ->(env) { SessionsController.action(:new).call(env) },
    on_registration: ->(env) { IdentitiesController.action(:new).call(env) }
end

with Rails4.1

sanemat commented Jun 15, 2013

My work around solution:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :identity,
    on_login: ->(env) { SessionsController.action(:new).call(env) },
    on_registration: ->(env) { IdentitiesController.action(:new).call(env) }
end

with Rails4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment