Redirects not working in chrome.identity

I was working on a chrome app that uses an API chrome.identity.launchWebAuthFlow

to authenticate users to their google account.

Setting:

  • Clicking the app login button executes this code: chrome.identity.launchWebAuthFlow({'url': <AUTH-URL>, 'interactive': true}, function(redirect_url) { <handle URL here> } });

<AUTH-URL>

points to an endpoint on my own server that redirects to https://accounts.google.com/o/oauth2/auth?response_type=code&redirect_uri=http://<APP-ID>.chromiumapp.org/...&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile+https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=offline&approval_prompt=force

This thread worked fine until two days ago. Clicking the button will open the chrome identification window, show the google login page, and entering my credentials will trigger a callback function.

It stopped working today. I just see that the message "The page authorization could not be loaded" as soon as I press the login button.

I tried setting a 5 second delay on the server (before redirecting), but the message "Authorizing the page could not be loaded" appears before 5 seconds.

Any ideas what might be going on?

+3


source to share


1 answer


We finally figured it out after 2 days later the login flow was down. The page that was rendered ( <AUTH-URL>

) contained a snippet of Google Tag Manager.

We recently updated this to include MixPanel. This resulted in multiple <script>

attribute elements async

being injected onto the page. Removing Mixpanel from GTM fixed the issue instantly.



I guess removing the tag <script async ...>

did the trick. It wasn't just an OAuth flow - simple links <a>

didn't work either.

0


source







All Articles