daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Feb 22nd, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.     });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top