Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. var authorisationRequestData =
  2. {
  3. 'client_id': clientId,
  4. 'scope': scopes,
  5. 'immediate': immediate,
  6. prompt: 'consent',
  7. access_type: 'offline',
  8. include_granted_scope: true,
  9. }
  10.  
  11. const authInstance = gapi.auth2.getAuthInstance();
  12. authInstance.grantOfflineAccess(authorisationRequestData)
  13. .then((res) => {
  14. console.log(gapi.auth.getToken());
  15. var all_token = JSON.stringify(gapi.auth.getToken());
  16. console.log("Token =" + all_token);
  17. console.log(res);
  18. console.log(res.code);
  19.  
  20. }).catch(error => {
  21. console.log(error);
  22. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement