Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

341
Visualizações
Chrome extension get auth token without using chrome app

I am trying to get an auth token using:

chrome.identity.getAuthToken({ interactive: false }, function (token) {
    console.log('token', token);
});

token is undefined and I receive the error:

Unchecked runtime.lastError: OAuth2 request failed: Service responded with error: 'bad client id

my manifest json's oauth2 looks like this:

"version": "1.0",
"manifest_version": 3,
"background": {
    "service_worker": "background.js"
},
"oauth2": {
    "client_id": "<my_client_id>.apps.googleusercontent.com",
    "scopes": [
        "profile email",
        "https://www.googleapis.com/auth/userinfo.email",
        "https://www.googleapis.com/auth/drive.file"
    ]
},

I added my client id following the instructions here:

https://developer.chrome.com/docs/extensions/mv3/tut_oauth/#oauth_client

I notice that the instructions say:

On the Create client ID page, select Chrome App

However, chrome apps are being deprecated. So I have two questions, why is my client id bad, and is there a way to auth a user without using a chrome app, as chrome apps are being deprecated.

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda