Get access token after client authorization
See original GitHub issueHi i am building a JavaFX application for Google Drive with basic functionality as (download,upload etc). I am using JavaFX Browser for user Authentication , so i can navigate to the URL and then get the html code .
1)I need to get the Authentication URL 2)I will authenticate with JavaFX Browser , so my question is : -> is the access token shown on the html code?
How to figure the method authorize
of DriveSample to return me the Authentication URL :
/**
* Authorizes the installed application to access user's protected data.
*/
private static Credential authorize() throws Exception {
// load client secrets
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY,
new InputStreamReader(DriveSample.class.getResourceAsStream("/client_secrets.json")));
if (clientSecrets.getDetails().getClientId().startsWith("Enter")
|| clientSecrets.getDetails().getClientSecret().startsWith("Enter ")) {
System.out.println(
"Enter Client ID and Secret from https://code.google.com/apis/console/?api=drive "
+ "into drive-cmdline-sample/src/main/resources/client_secrets.json");
System.exit(1);
}
// set up authorization code flow
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(httpTransport,
JSON_FACTORY, clientSecrets, Collections.singleton(DriveScopes.DRIVE_FILE))
.setDataStoreFactory(dataStoreFactory).build();
// authorize
return new AuthorizationCodeInstalledApp(flow, new LocalServerReceiver()).authorize("user");
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:8
Top Results From Across the Web
Obtaining an Access Token by Using a Client Authorization ...
The client credentials workflow allows the client application to obtain an access token by using the basic authorization header.
Read more >How to get an access token with Auth Code Grant | DocuSign
Open the Apps and Keys page. · Under My Apps / Integration Keys, choose the integration key to use, then select Actions, then...
Read more >Get Access Tokens - Auth0
After an access token has expired, you can renew your access token. To do so either re-authenticate the user using Auth0 or use...
Read more >Client access token | Authentication - publiq - Stoplight
The client can request a token on publiq's authorization server with its client id and client secret, and include this token in API...
Read more >How to get an access token - Tink Docs
Prerequisites · Authorize access to your backend client · Add a user · Grant access to a user · Get the OAuth access...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
problem occurred because of headless system of spring boot, headless system’s can’t open browser so use this below code to set headless false in spring boot
public static void main(String[] args) { SpringApplicationBuilder builder = new SpringApplicationBuilder(App.class); builder.headless(false).run(args); }
Thank you very much, very helpful!