Hi,
I am a java developer and integrating goole calendar api, i am able to get the events from the google but i want to simplify this process so that the user won't have to do copy-and-paste stuff for the authorization code to be received to get the access token? Currently all I know is that I will need to provide a callback url, but every time when the token expire's we have to open the browser for that.
My Question is can avoid this opening the bwoser or simplify this.
My code is :
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load(JSON_FACTORY, new InputStreamReader(in));
GoogleAuthorizationCodeFlow flow = new GoogleAuthorizationCodeFlow.Builder(HTTP_TRANSPORT, JSON_FACTORY, clientSecrets, SCOPES)
.setDataStoreFactory(new FileDataStoreFactory(new java.io.File(TOKENS_DIRECTORY_PATH)))
.setAccessType("offline").build();
LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();
Credential credential = new AuthorizationCodeInstalledApp(flow, receiver).authorize("user");
Best Regards,
Noor.