Question

Permissible I have a service that provides to access another data service(googledrive).

Is this possible that saves access data of user for further using it?

User choose a googledrive in my service and i rederict he to authentication page of google. He accept this and working on this. Via some days he wants work on the googledrive service and he should be able do this without accepting. How can i do this?

I hope that i explain what wanting..

Regards beforehand!!

Was it helpful?

Solution

If the user is present/interacting with your app whenever you need to connect to the Drive API, then you don't need to do anything special. Whenever the access token expires (ever 1h) just reauthorize in a popup (or hidden iframe if you set immediate=true in the request) and this will generate a new access token without re-prompting the user. This works so long as the user doesn't revoke access to your app.

If you need to access Drive in background proceses or queues where you can't interact with the user, then include access_type=offline when making the initial authorization request. This will produce a refresh token in addition to the access token. The refresh token can be used to obtain new access tokens without user interaction so long as they haven't revoked access.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top