Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

2.4K
Views
Tiene problemas con Google OAuth2 (la aplicación no tiene backend, por lo que solo está en el lado del cliente)

Estoy tratando de implementar solo el inicio de sesión del lado del cliente usando OAuth. Obteniendo el siguiente error:

 details: "You have created a new client application that uses libraries for user authentication or authorization that will soon be deprecated. New clients must use the new libraries instead; existing clients must also migrate before these libraries are deprecated. See the [Migration Guide](https://developers.google.com/identity/gsi/web/guides/gis-migration) for more information." error: "idpiframe_initialization_failed"

Después de eso, cada vez que intento iniciar sesión, aparece el siguiente error:

 error: "popup_closed_by_user" [[Prototype]]: Object

En este momento estoy trabajando en localhost: 3000, por lo que agregué http://localhost: 3000 como origen JS autorizado en las ID de cliente de OAuth 2.0, también intenté cambiar el estado de publicación de prueba a producción. El tipo de usuario está establecido en Externo.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Tuve el mismo error, pero en la aplicación React. ahí está la solución

 import React, { useEffect } from 'react'; import { GoogleLogin, GoogleLogout } from 'react-google-login'; import env from 'react-dotenv'; import { gapi } from 'gapi- script'; function AuthPage() { useEffect(() => { function start() { gapi.client.init({ clientId: env.REACT_PUBLIC_GOOGLE_CLIENT_ID, scope: 'email', }); } gapi.load('client:auth2', start); }, []); // **you can access the token like this** // const accessToken = gapi.auth.getToken().access_token; // console.log(accessToken); const onSuccess = response => { console.log('SUCCESS', response); }; const onFailure = response => { console.log('FAILED', response); }; const onLogoutSuccess = () => { console.log('SUCESS LOG OUT'); }; return ( <div> <GoogleLogin clientId={env.REACT_PUBLIC_GOOGLE_CLIENT_ID} onSuccess={onSuccess} onFailure={onFailure} /> <GoogleLogout clientId={env.REACT_PUBLIC_GOOGLE_CLIENT_ID} onLogoutSuccess={onLogoutSuccess} /> </div> ); } export default AuthPage;
about 4 years ago · Juan Pablo Isaza Report

0

De forma predeterminada, las ID de cliente recién creadas ahora no pueden usar la Biblioteca de plataforma anterior, las ID de cliente existentes no se ven afectadas. Los nuevos ID de cliente creados antes del 29 de julio de 2022 pueden establecer plugin_name para permitir el uso de la biblioteca de la plataforma de Google.

Entonces, en mi caso, la solución fue:

 window.gapi.load('client:auth2', () => { window.gapi.client.init({ clientId: '******.apps.googleusercontent.com', plugin_name: "chat" })
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!