I am using the google drive API and am running into a problem. I have a JAVA application that follows the documentation steps to implement the service, my problem is with the token that expires every so often. What I need is that it does not have an expiration time or that it can be done automatically to avoid manipulating the browser, since I plan to use my program to create automatic backups and the user does not have to participate. I have already tried with update tokens:
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")
.setApprovalPrompt("force")
.build();
LocalServerReceiver receiver = new LocalServerReceiver.Builder().setPort(8888).build();
Credential cr = new AuthorizationCodeInstalledApp(flow, receiver).authorize("user");
boolean refresToken = cr.refreshToken();
logger.info("Token is refresh: "+refresToken);
but they only last up to 7 days, from there I have the following message:
Google Drive: com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request POST https://oauth2.googleapis.com/token { "error" : "invalid_grant", "error_description" : "Token has been expired or revoked." }
Any comment is appreciated, thank you.
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
So I have a superclass called Tile and many subclasses like BlueTile, GreenTile etc
I have a spring boot applicate that is using many types of date objects it like:
I have a loop which goes through an array (files) of objects (person)If the person works as a doctor or a vet I would like to display their row at the top of the table, if not, they should be displayed under the doctors and vets
Like in other programing languages - python or JS, when we create a rest api specifically post for the request body we attract some JSON Object