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

511
Views
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 4 years ago · Juan Pablo Isaza
1 answers
Answer question

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 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!