Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var authorisationRequestData =
- {
- 'client_id': clientId,
- 'scope': scopes,
- 'immediate': immediate,
- prompt: 'consent',
- access_type: 'offline',
- include_granted_scope: true,
- }
- const authInstance = gapi.auth2.getAuthInstance();
- authInstance.grantOfflineAccess(authorisationRequestData)
- .then((res) => {
- console.log(gapi.auth.getToken());
- var all_token = JSON.stringify(gapi.auth.getToken());
- console.log("Token =" + all_token);
- console.log(res);
- console.log(res.code);
- }).catch(error => {
- console.log(error);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement