13

I'm trying to integrate Instagram login into my app to get the logged in user's details, I've registered my app on Instagram and got my client ID, then I added a new URL Type in the project settings with the identifier: igxxxx (where xxxx is my client id), i've also set the redirect URI to be (xxxx://authorize), once I successfully log in (using a webView) Instagram displays a white blank page with (400 Bad Request) text written on top, however, when I change the redirect URI to anything else, it opens without problems after a successful login.
how can I redirect the user to the app after he logs in with Instagram.

p.s. I use this library to ease up things.

thanks in advance.

12
  • any update on this ? Even in Android it is throwing 400. it was working fine previously – Mohammed Imran N Jun 19 '16 at 19:04
  • if you change the redirect URI to anything else it will work, by the way, if you show a web view inside the app to login to Instagram then you don't have to use the xxxx://authorize URI because you are already inside the app and don't have to let Instagram redirect you to the app, it sounds that Instagram API has deprecated the redirect URI scheme of xxxx:://authorize – JAHelia Jun 19 '16 at 19:08
  • is that working fr you after those changes ? – Mohammed Imran N Jun 19 '16 at 19:12
  • 2
    FWIW based on my tests, URLs that don't start with http or https stopped working as of yesterday/today. We had to do a bit of code reshuffling to make it work without the redirect-uri but it seems fine now. – Rog Jun 20 '16 at 5:13
  • 1
    @JordanBonitatis Change your redirect-url to anything that starts with http or https and use a UIWebView for authentication instead of redirecting to Instagram and back to your app. – Rog Jun 21 '16 at 0:16
2

Here's what I have found so far. I have been able to resolve the issue to get the app to work on the iPhone. However, this solution doesn't allow me to submit the app on the app store as you will read ahead. I have submitted a bug with instagram, not sure how long they will take.

I would suggest everyone go to this link and "Report Issue":

https://www.instagram.com/developer/clients/manage/

I have had an app in app store for couple months without problems. However, since June 19, all the users trying to authenticate get a white page with "400 Bad Request" after they login with their IG account.

The issue is very common as you will see on this stack overflow page:

Instagram API prevents redirection to iOS app upon successful login with 400 bad request error

And google shows the same issue with many users since June 19.

I have figured out that the old redirect URI which we were using:

myappname://

is the issue.

If we change this redirect URI to:

http://myappname

or

https://myappname

This all starts working fine and we get the access token.

However as per RFC1738, this is not a valid format for URL schemes which is used in iOS development.

So we get error when submitting our apps to app store:

ERROR ITMS-90158: "The following URL schemes found in your app are not in the correct format: [https: //myappname]. URL schemes need to begin with an alphabetic character, and be comprised of alphanumeric characters, the period, the hyphen or the plus sign only. Please see RFC1738 for more detail."
ERROR ITMS-90158: "The following URL schemes found in your app are not in the correct format: [https: //myappname]. URL schemes need to begin with an alphabetic character, and be comprised of alphanumeric characters, the period, the hyphen or the plus sign only. Please see RFC1738 for more detail."

So we can't submit to app store with this solution.

So unless instagram does something to fix this back to how it used to be, we are stuck :(

5
  • i didn't get any responses to this :( – Pranoy C Jul 5 '16 at 20:55
  • Wait a sec... Why do you have that under "URL Schemes" and not just as a regular: "InstagramAppRedirectURL" string? – mystic cola Jul 8 '16 at 0:26
  • Where exactly are you setting your RedirectURL in your app? And why did you add a new URL type? – mystic cola Jul 8 '16 at 2:29
  • Has there been any update to this issue? A suggested fix? thanks – Edward Potter Aug 17 '16 at 9:19
  • Is there any update on issue ? what is the alternative ? – Jen Jose Sep 16 '16 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.