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

前端 未结 10 1656
甜味超标
甜味超标 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:18

    Fixed the issue myself. Added localhost:3000/auth/instagram/callback as redirect_uri and it worked just fine.

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

    For anyone that is having this issue and the redirect uri provided to instagram is exactly the same as the one you're using, i've found that some users were typing my website address as http://www.example.com/login when in my instagram api it was http://example.com/login.

    Then I created a php script to detect if the string www exists in my url and then reload to the same page but without the www.

    if(strpos($_SERVER['HTTP_HOST'], 'www.') !== FALSE) {
        header("Location: ".str_replace('www.', '', $_SERVER['HTTP_HOST'].'/'.$_SERVER['REQUEST_URI']));
    }
    
    0 讨论(0)
  • 2020-12-15 07:19

    Issue: Oauth2 Instagram API “redirect URI does not match registered redirect URI

    My Solution: Please check ng-cordova-oauth.js file and check instagram function in that. Verify redirect_uri value is same as register your application on developer console for Instagram.If it is same it works properly,otherwise you get the above issue.

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

    For Drupagram module (Drupal 7) added: http://localhost:3000/instagram/oauth as redirect_uri

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

    I needed to add

    http://localhost:3000/users/auth/instagram/callback
    

    as my callback URI because I'm using Devise.

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

    {"error_type": "OAuthException", "code": 400, "error_message": "Redirect URI does not match registered redirect URI"}

    How to get Access token from instagram

    Your website url must be same when registering sandbox clien api on instagram https://www.instagram.com/developer/

    here we used website url: https://adlivetech.com Valid redirect URIs: https://adlivetech.com/

    For live website you can get Access token easily by using https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=REDIRECT-URI&response_type=token

    Replace above url "CLIENT-ID" with your client ID Replace above url "REDIRECT-URI" redirect url should be your domain name like: http://adlivetech.com

    https://adlivetech.com/access_token=YOUR_ACCESS_TOken

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