-
Notifications
You must be signed in to change notification settings - Fork 164
Open
Description
Hey @kmrshntr: do you have any pointers on using multiple scopes with Devise? I'd like the users for a Slack team to be able to "Sign in using Slack" (identity.basic scope) and then add my bot (bot scope). At the moment, I'm using a manual "Add to Slack" button (as per their documentation) which produces a link like this:
'https://slack.com/oauth/authorize?client_id=1234.5678&scope=bot
However, when it redirects back to my application, I get:
Started GET "/users/auth/slack/callback?code=snip&state=" for 127.0.0.1 at 2018-06-10 13:07:36 +0200
INFO -- omniauth: (slack) Callback phase initiated.
ERROR -- omniauth: (slack) Authentication failure! csrf_detected: OmniAuth::Strategies::OAuth2::CallbackError, csrf_detected | CSRF detected
Processing by Auth::OmniauthCallbacksController#failure as HTML
Parameters: {"code"=>"snip", "state"=>""}
Two questions:
- Do you know why this is being detected as a CSRF? Ideally, an OAuth token would be returned by that call, that I could associate with the Team in my database.
- Can I have two
config.omniauth :slackdefinitions indevise.rb, with different names? If so, how can I use those names when I'm generating links? Can I pass parameters touser_slack_omniauth_authorize_path?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels