Skip to content
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

Getting access_denied | The user denies your request while I accept the request #40

Open
mathieubrunpicard opened this issue Apr 3, 2019 · 1 comment

Comments

@mathieubrunpicard
Copy link

Hey guys,

I am currently trying to set a OAuth connexion via Instagram and I found this gem. I successfully plugged it for Facebook, linkedin and Google + but I am currently struggling with Instagram connexion.

The reason is that I get this error when I click on "Authorize" on the Instagram connexion page

ERROR -- omniauth: (instagram) Authentication failure! user_denied: OmniAuth::Strategies::OAuth2::CallbackError, access_denied | The user denied your request.

I hence get redirect to my failure method:

Parameters: {"error_reason"=>"user_denied", "error"=>"access_denied", "error_description"=>"The user denied your request.", "state"=>"d54f932ff4bada3abd784e39886b96d324f753929d410d97"}

Here is how I configured my provider in my devise.rb file :

config.omniauth :instagram, instagram_id, instagram_secret, {
    scope: "basic"
  }

Nothing fancy going on here.
Here are the version of the gems that I am using :

omniauth-instagram (1.3.0)
      omniauth (~> 1)
      omniauth-oauth2 (~> 1)

I tried looking it up but I couldn't find any related solutions.

Thanks for your feedback

@mrjamesriley
Copy link

mrjamesriley commented Apr 4, 2019

Hello,

We've been seeing the shame issue. Shockingly it appears to be an issue when the authorisation screen at Instagram is anything but English. See the following:

https://twitter.com/vdwijngaert/status/1112999130878619649
https://developers.facebook.com/support/bugs/1766879903442787/

The solution appears to be:

Appending the undocumented suffix "&hl=en" to the auth url also works as a fix, as it changes the language to English. Might be useful for non-tech users.

Will report back once we've confirmed it as working! 👍

UPDATE

The solution we've gone with is to set the hl=en in the config.omniauth, e.g:

config.omniauth :instagram, INSTAGRAM_APP_ID, INSTAGRAM_APP_SECRET, scope: 'basic', authorize_params: { hl: 'en' }

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

No branches or pull requests

2 participants