Sunday, September 11, 2016

Instagram OAuth Authentication - www.instagram.com redirected you too many times

Leave a Comment

I'm trying to use the server side explicit OAuth flow to allow a user authenticate with Instagram, so my application can retrieve media on their behalf.

I have configured my client on Instagram, which is in Sandbox mode, to redirect to https://localhost:44320/Admin/Instagram/OAuth.

I am redirecting the user to Instagram using this Url:

https://api.instagram.com/oauth/authorize?client_id=CLIENT_ID_IS_HERE&redirect_uri=https%3A%2F%2Flocalhost%3A44320%2FAdmin%2FInstagram%2FOAuth%3FweddingId%3D2&response_type=code&scope=public_content

My problem is that if the user is already authenticated, or successfully authenticates on Instagram, the redirect to my callback URL does not reach my endpoint and Chrome throws the "ERR_TOO_MANY_REDIRECTS" error. It also happens on IE Edge browser but it just hangs rather than giving an error.

From inspecting the network activity on Chrome, there is bouncing back and forth from:

https://www.instagram.com/oauth/authorize?client_id=...

to

https://www.instagram.com/integrity/checkpoint/?next=/oauth/authorize

and then back again.

I can't find any information on the Developer documentation and here on S/O from people experiencing the same thing.

I'd appreciate any help or suggestions as I'm stuck here!

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment