Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
712 views
in Technique[技术] by (71.8m points)

api - Instagram Auth Broken?

We just noticed that our app which relies on Instagram as the primary login is no longer working. In investigating this further, it appears the callback URL for Instagram stopped working. Now whenever anyone logs in via Instagram or signs up via Instagram, they are taken to the Instagram app instead of being asked to authenticate or taken into our app experience.

I checked another app that I know if, called "Print Studio" and the same thing is happening to them.

Is this issue happening to anyone else? Any clue as to what is causing it and has anyone heard from Instagram on a possible fix?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes. seems to effect all applications (at least the apps that are using the approved 3rd party API). I saw this issue few days ago and it got resolved by itself. I assume Instagram engineers are rolling some updates and broke something.

I suggest reporting an issue from the developer portal. https://www.instagram.com/developer/clients/manage/. as many reports as they receive, the better.

UPDATE:

The issue seems to be related to cookies / session persistent changes made on Instagram side. To workaround the issue, redirect the user to the original auth url when you detect the user got to the Instagram homepage. Because the user is already logged in, this should pass the user to the correct redirect url without logging in again.

for example, in swift:

  // MARK: - WKNavigationDelegate
  override func webView(_ webView: WKWebView, decidePolicyFor navigationAction: WKNavigationAction, decisionHandler: @escaping (WKNavigationActionPolicy) -> Void) {

   if let urlString = navigationAction.request.url?.absoluteString {

     if urlString == "https://instagram.com" || urlString == "https://instagram.com/" ||
      urlString == "https://www.instagram.com" || urlString == "https://www.instagram.com/" ||
      urlString == "http://instagram.com" || urlString == "http://instagram.com/" ||
      urlString == "http://www.instagram.com" || urlString == "http://www.instagram.com/" {

        decisionHandler(.cancel)
        self.refresh(nil) // reloads the original auth url
        return
      }
    }

    super.webView(webView, decidePolicyFor: navigationAction, decisionHandler: decisionHandler)
  }

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...