Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

404
Vistas
Electron Google Login: "This browser or app may not be secure"

Google Logins have usually favored mainstream browsers, and so until now, to get it to work on Electron you would need to change the userAgent string to Chrome. However, after getting reports from users last week, I found that this no longer works.

Opening a Google signin URL using the following code:

const win = new BrowserWindow({
  height: 600,
  width: 800
})
const client = new google.auth.OAuth2(
  clientId, clientSecret, "urn:ietf:wg:oauth:2.0:oob"
)
const url = client.generateAuthUrl({
  access_type: "offline",
  scope: scopes
})
win.loadURL(url, {
  userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.82 Safari/537.36 Edg/93.0.961.52"
})

This still yields the This browser or app may not be secure error and prevents Google signin from working.

I'm hoping there is a solution to getting Google signin working on Electron again.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

There might be some tricks to work this around, but they will most likely be blocked by Google, eventually. They did give head-ups about this in Google Developer blog:

  • Upcoming security changes to Google's OAuth 2.0 authorization endpoint in embedded webviews".

The proper solution is to use the user's default browser for OAuth2 authorization flow UI (rather than a custom WebView popup), as required by "RFC8252: OAuth 2.0 for Native Apps":

OAuth 2.0 authorization requests from native apps should only be made through external user-agents, primarily the user's browser. This specification details the security and usability reasons why this is the case and how native apps and authorization servers can implement this best practice.

One good reason for this is that the user might already be authenticated with Google in their default browser, so they don't have to enter the password / go through MFA flow once again. They would only see the authorization request for your specific app, which they may decide to approve or reject.

One other good reason is that they could use a password manager of their choice, which most likely works with their default browser but not with your Electron app.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda