0

I'm having issues with my authentication on a Chrome Extension that I am working on to learn. Currently, my extension works for my profiles if users are logged in. As soon as I test this (by giving another party access), the extension does not seem to authorize. Am I doing something wrong here?

Could the below code be causing the issues with authentication? To give some context, this is in the background.js file of my extension.

function auth(token){
  chrome.identity.getAuthToken({ 'interactive': true }, function (token) {

if (chrome.runtime.lastError) {
  console.log(chrome.runtime.lastError);
  //Push Manual Authorise Button to UI
} else {
  //Authorised
  console.log('Token acquired: ' + token +
    ' See chrome://identity-internals for details.');
  classroomsExist(token);
}
return token;
  });
}

Update: I have tested this on another user account by loading the extension manually, as an unpacked extension and the authentication works. What could be causing the issue when installing from the webstore? My application ID is the same in manifest.json as Google Developer Console.

1 Answers1

0

The client_id changes when you publish, so the manifest.json and app code needs to update any references to it when publishing to the web store.

sarora
  • 913
  • 9
  • 20