New issue
Advanced search Search tips

Issue 695498 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

chrome.identity.getAuthToken opens a Chrome signin tab when any SERVICE_ERROR occure.

Project Member Reported by mad@chromium.org, Feb 23 2017

Issue description

Chrome Version: Version 56.0.2924.87 (64-bit & 32-bit too)
OS: Win7 & Win10

What steps will reproduce the problem?
(1) Load an extension with the code below
(2) Click on the browser action button
(3) Witness the signin tab

What is the expected result?
The current Chrome signin state should be used, and no tab should be opened to sign in.

What happens instead?
The signin tab is opened, always, and even after signing in, the callback receiving the token is never called.

background.js:
========================
chrome.browserAction.onClicked.addListener(function (Tab) {
  console.log("clicked");
  chrome.identity.getAuthToken({ 'interactive': true }, function(token) {
    console.log(token);
  });
});
========================
manifest.json
========================
{
  "name": "Identity bug repro",
  "version": "0.1",
  "description": "To test a potential identity bug",
  "permissions": [
    "identity"
  ],
  "browser_action": {
    "name": "Identity test",
    "default_title": "Identity"
  },
  "background": {
    "page": "background.html",
    "persistent": true
  },
  "oauth2": {
    "client_id": <clientId>,
    "scopes": ["https://www.googleapis.com/auth/drive"]
  },
  "manifest_version": 2
}
========================
To add to the weirdness, the extension I'm working on that use this functionality, is currently installed on my laptop and works fine. But when I try to install it again, it doesn't anymore... Even if I refresh the working extension it keeps working, but when I try to install it again (exact same code, on same or different profile/machine) it doesn't work... The newly installed extension behaves as described above, whereas the one that I installed a few days ago, works correctly... Really weird...

 

Comment 1 by msarda@chromium.org, Feb 24 2017

Status: Assigned (was: Untriaged)
Thank you for the repro case. At this moment I am swapped with other bugs, so I will not have time to look into this bug very soon.

Comment 2 by mad@chromium.org, Mar 13 2017

Labels: -Pri-2 Pri-3
Summary: chrome.identity.getAuthToken opens a Chrome signin tab when any SERVICE_ERROR occure. (was: chrome.identity.getAuthToken always opens a Chrome signin tab)
I dug in the debugger and found that the initial error was on my side. The reason why the first extension I installed still worked, is that my OAuth client ID was associated to that extension specific extension ID, which was a loaded unpacked extension (so that ID wasn't sticky).

But there still is an issue with the error handling, which opens the Chrome signin page when such an error occur, when the user actually is signed in.

So I updated the summary, and lowered the priority.

Sign in to add a comment