I am having troubles with my server-side login flow to Instagram. I am using:
passport.js
(passport-instagram) in my Node.js server, at the domain example.com
WebView
in my android client.The issue is that sometimes after typing the credentials the client is not redirected to the callback url.
https://example.com/auth/instagram : user visits my server and is redirected to instagram
https://api.instagram.com/oauth/authorize/?response_type=code&redirect_uri=https%3A%2F%2Fexample.com%2Fauth%2Fredirect%2Finstagram&client_id=XXXXX
https://example.com/auth/redirect/instagram?code=YYYYY : we reach the callback url
https://example.com/auth/instagram : user visits my server and is redirected to instagram
https://api.instagram.com/oauth/authorize/?response_type=code&redirect_uri=https%3A%2F%2Fexample.com%2Fauth%2Fredirect%2Finstagram&client_id=XXXXX : same as before
https://www.instagram.com/oauth/authorize/?response_type=code&redirect_uri=https://example.com/auth/redirect/instagram&client_id=XXXXX
https://www.instagram.com/accounts/login/?force_classic_login=&next=/oauth/authorize/%3Fresponse_type%3Dcode%26redirect_uri%3Dhttps%3A//example.com/auth/redirect/instagram%26client_id%3DXXXXX : here I type my credentials
https://www.instagram.com/
As you can see, at the end of the login, instead of being redirected to my server, I end up in https://www.instagram.com/ (successfully logged in, by the way).
Why is this happening?
I have no idea myself. Everything seems properly encoded. Might be some Android WebView
setting that has to be tweaked (but the same WebView works great with authenticating with other auth providers), might be some passport.js
configuration error (but I am using it successfully for all other providers), ...
having the same issue on my end and have replicated it on other live apps that use Instagram connect.
I've filed a bug report with Instagram but their developer support is quite minimal and I'm not sure if I'll hear back.
That said, I have to assume this is impacting a number of apps and not just ours so hopefully they are working on a fix.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With