Oauth2 Instagram API “redirect URI does not match registered redirect URI”

前端 未结 10 1657
甜味超标
甜味超标 2020-12-15 06:41

I am working on a Rails application which is in development mode and it can register with omniauth.

The host is

http://localhost:3000/
相关标签:
10条回答
  • 2020-12-15 07:32

    ...Or you can follow the instructions here:

    https://instagram.com/developer/authentication/?hl=en

    See "Step One: Direct your user to our authorization URL" section.

    Just simply supply your CLIENT_ID and REDIRECT_URI.

    https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=code
    
    0 讨论(0)
  • 2020-12-15 07:37

    When you specify a redirect URI http://localhost:3000 is not the same as http://localhost:3000/ (note the trailing slash).

    Make sure the callback URI matches exactly.

    0 讨论(0)
  • 2020-12-15 07:38

    I mucked around with this for ages.. perhaps it has changed but: http://localhost:3000/users/auth/instagram/int_callback was the callback URI that finally worked for me. The ONLY issue i was having was that it was exactly an incorrect callback uri and wish I had seen here that I should be focusing on my Instagram setup instead of modifying my code.. to get the error message means everything else is working (so far), otherwise you would not be getting that particular error message. Good luck!! - don't get distracted!

    0 讨论(0)
  • 2020-12-15 07:43

    This isn't a ruby-specific but for anyone else wrestling w/this here's what got me past it (note: nothing in above answers worked for me):

    • 1. Edit your Client on Instagram Developer and uncheck Disable implicit OAuth.
    • 2. Click Update Client to save it.
    • 3. Now go to https://instagram.com/oauth/authorize/?client_id=[CLIENT_ID]&redirect_ur.... Just change [CLIENT_ID] and [REDIRECT_URI] with their values.
    • 4. After that you will be redirected to [REDIRECT_URI]/#access_token=[ACCESS_TOKEN]. Get it and place it on the Instagram Access Token textbox.

    (Source: https://www.drupal.org/project/instagram_feeds/issues/2140479)

    0 讨论(0)
提交回复
热议问题