Instagram authentication problem

In my app I have 3 different ways to use Instagram Auth and need to redirect to 3 different locations depending on the action. because of this i have 3 different urls url urls

My registered redirect url is http://nameoftheapp.com/folder/

Url url 1:

https://api.instagram.com/oauth/authorize/?client_id='
    + ig_id
    + '&response_type=code&redirect_uri='
    + encodeURI('http://nameoftheapp.com/folder/?l=r'); 

      

URL 2 authentication

https://api.instagram.com/oauth/authorize/?client_id='
    + ig_id
    +'&response_type=code&redirect_uri='
    + encodeURI('http://nameoftheapp.com/folder/?l=g');

      

Url url 3:

https://api.instagram.com/oauth/authorize/?client_id='
    + ig_id
    +'&response_type=code&redirect_uri='
    + encodeURI('http://nameoftheapp.com/folder/?l=l');

      

Now all of these URLs take me back to the correct URL, adding code to it, ready to turn into an access token.

With no parameters inside the EncodeURI, this allows me to access the data I need. If i save the parameters i get below HTTP400 error

[23-Aug-2014 10:26:40 Europe/Berlin] Array
(
    [code] => 400
    [error_type] => OAuthException
    [error_message] => Redirect URI doesn't match original redirect URI
)

      

If you look at this page in the Instagrams documentation it says it allows you to use the parameters http://instagram.com/developer/authentication/

+3


source to share


2 answers


I had the same problem getting the access token using PHP, I issue it using the same redirect_uri url like:

If the Auth URL http://nameoftheapp.com/folder/?l=l

after Instagram login sends you a redirect_uri http://nameoftheapp.com/folder/?l=l&code=<CODE>

. Thus, in this file, according to the CURL parameters, the same URL http://nameoftheapp.com/folder/?l=l

with the same GET-variables is used to get information or access the token from Instagram .



I know this is an old post, but it might be helpful for sometone like me who ends up in this post looking for an answer.

+2


source


The documentation shows

Registered Redirect URI http://yourcallback.com/callback

You have



My registered redirect url is http://nameoftheapp.com/folder/

Try removing the trailing slash ...?

0


source







All Articles