Optional resource name to look up on the server
Objects
Google OAuth Client ID
Refresh Token (Use Google Oauth Playground to generate a refresh token) See: https://developers.google.com/oauthplayground/
Google Api's Client Secret
Promise
The Access Token or none
void
Generated using TypeDoc
Warning: Please make sure that as of version
0.0.23
we have removed theapplication/json
content type headers from this function. This may cause an issue if you originally didn't construct your request content type headers withapplication/json
.fetch(url, { headers: createOAuthHeaders(), })
If you require your server to handle authenticating multiple users across many resources (or tables) then pass in the name of the resource, for Example:
fetch(url, { headers: createOAuthHeaders("users"), })
With the resource value, the following headers are constructed:
{ "X-Auth-Token" : "<TOKEN>", "X-Auth-Resource": "users", }