Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

19
LINES

< > BotCompany Repo | #1028411 // Google Calender Auth Data Grabber [LIVE]

JavaX source code (desktop) [tags: butter use-pretranspiled] - run with: x30.jar - homepage

Download Jar. Libraryless. Click here for Pure Java version (6708L/44K).

1  
!7
2  
3  
html {
4  
  // needed for initiation and callback
5  
  S redirect_uri = fullRawLink("/callback");
6  
  
7  
  if (eq(uri, "/callback")) {
8  
    S code = assertNempty(params.get("code"));
9  
    Map tokenMap = googleAuthorizationCodeToTokens_raw(googleBotCompanyClientID(), googleBotCompanyClientSecret(), redirect_uri, code);
10  
    printStruct(+tokenMap);
11  
    // Tokens will be in "access_token" and "refresh_token"
12  
13  
    ret printAndProgramLog("We're back from Google! " + hpre(pnlToString(params) + "\n" + pnlToString(tokenMap)));
14  
  }
15  
  
16  
  S client_id = googleBotCompanyClientID();
17  
  S scope = "https://www.googleapis.com/auth/calendar";
18  
  ret hrefresh(2.0, print(googleOAuthRedirectURL(print(+redirect_uri), client_id, scope))) + "Redirecting to Google...";
19  
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1028411
Snippet name: Google Calender Auth Data Grabber [LIVE]
Eternal ID of this version: #1028411/15
Text MD5: c8eb52d1cddf58a19b5b081373d98644
Transpilation MD5: 03876b4f6b824763ef0335397666f3fd
Author: stefan
Category: javax
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-08-03 12:44:12
Source code size: 763 bytes / 19 lines
Pitched / IR pitched: No / No
Views / Downloads: 181 / 921
Version history: 14 change(s)
Referenced in: [show references]