Instagram Auth Broken?

一世执手 提交于 2019-11-30 08:26:48

问题


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?


回答1:


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)
  }


来源:https://stackoverflow.com/questions/40226215/instagram-auth-broken

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!