Instagram: Redirect URI does not match registered redirect URI

16,635

You will need to URL encode the value of the redirect_uri parameter to http%3A%2F%2Flocalhost%3A8000 to prevent that the scope parameter becomes a part of the redirect_uri value instead of the authorization request.

You'll also have to make sure that the redirect_uri matches exactly, including the last slash that you've registered it with.

So then authorization request becomes:

https://instagram.com/oauth/authorize?response_type=code&client_id=2fa4359e4340434786e469ab54b9b8c0&redirect_uri=http%3A%2F%2Flocalhost%3A8000%2F&scope=likes
Share:
16,635
Admin
Author by

Admin

Updated on June 05, 2022

Comments

  • Admin
    Admin about 2 years

    Error

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

    Appeared on

    https://instagram.com/oauth/authorize?response_type=code&client_id=2fa4359e4340434786e469ab54b9b8c0&redirect_uri=http://localhost:8000&scope=likes
    

    Instagram settings

    CLIENT ID   2fa4359e4340434786e469ab54b9b8c0
    WEBSITE URL http://localhost:8000/
    

    Code

    $authProvider.oauth2({
      name: 'instagram',
      url: 'http://localhost:3000/auth/instagram',
      redirectUri: 'http://localhost:8000',
      clientId: '2fa4359e4340434786e469ab54b9b8c0',
      requiredUrlParams: ['scope'],
      scope: ['likes'],
      scopeDelimiter: '+',
      authorizationEndpoint: 'https://api.instagram.com/oauth/authorize'
    });
    

    Any help will be appreciated. Thanks!