• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

459
Vistas
Using GIS (Google Identity Services) and API Subpackage (picker) without client package

I am currently replacing the gapi.oauth2 package, by using the TokenClient according to the guide and everything works fine.

global.google.accounts.oauth2
        .initTokenClient({
            client_id: CONFIG.google.clientId,
            scope: 'https://www.googleapis.com/auth/drive.readonly',
            ux_mode: 'popup',
            callback(tokenResponse) {
                if (tokenResponse && !tokenResponse.error) {
                    onSuccess(tokenResponse.access_token);

                    return;
                }

                onError(tokenResponse.error || 'google authentication failed');
            },
        })
        .requestAccessToken({});

The only issue is that we are not using the gapi.client and would prefer avoiding loading that package as we are only using the token to show a picker by using google.picker.PickerBuilder. Now after the initialization the GSI package tries to use gapi.client.setToken() which obviously fails as the package is not loaded.

[GSI_LOGGER-TOKEN_CLIENT]: Set token failed. Gapi.client.setToken undefined.

So now i could not find anything in the reference on how to prevent that call to happen, nor how to at least suppress the warning by not e.g hacking in a noop as a placeholder.

Does anyone know if there is any official way to deal with that ?

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

0

In my tests the access token is successfully returned to the callback handler.

It looks to be an incorrectly generated warning, annoying yes, but functionally you're okay. A later, official release should remove the warning with no action on your part required.

about 3 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 Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda