For my project i have completed the entire auth flow in a server-side manner, writing my access codes and tokens to text files that can be used by my client-side application.
I am attempting to use gapi.auth.setToken() from the JS CLient Library to 'authorize' my application using this externally generated access token.
The problem occurs when i finally send requests to the various API's i need to access. i receive this error message:
{code: 403, message: "Daily Limit for Unauthenticated Use Exceeded. Continued use require signup.", data: Array[1], error: Object}
This leads me to believe that gapi.auth.setToken() is not doing what i expected it to do.
What am i missing here?
The signing algorithm in the JWT header must be used when computing the signature. The only signing algorithm supported by the Google OAuth 2.0 Authorization Server is RSA using SHA-256 hashing algorithm. This is expressed as RS256 in the alg field in the JWT header.
This worked for me :
gapi.auth.setToken({
access_token: "YOUR_TOKEN_HERE"
});
In fact this token object is the same as the one you get within the gapi.auth.authorize() callback. So if something doesn't works as expected, you can add more attributes from there to make it work. Anyway it's still a hack, although there is official documentation on it... Crappy gapi.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With