c# - Giving an application its own user id/session to access a google drive -
I have a C # MVC web application that needs to make a copy of Google Sheet (template) and read Set a copy / for existing user only, while the template owner has to read / write the copy.
Normally you give an ID to the application to do this type of function. I do not know how to apply independently from the current user ("user-2"), your ID and session ("user-1"). I do not want to read / write to the reader / user only to copy the template and I really like being out of the current user's Google login.
Depending on the OAuth access token, your application is bound to a specific user who submits it. Therefore it is provided that your app can retrieve an access token for User-2 (with a suitable scope), then you are good to go.
Obtaining Access Token for User-1 Depending on your app's instability and security requirements, you can do several ways. Originally your web app needs to have a fresh refresh token for the user-1, which can use it to bring an access token quietly. See for more information.
In your question, some vocabulary is a little straightforward.
- "id" - Each application when you register it on the Developer Console, it has its own ID, it has been sent as a client-id, to which some people think ID Misleading does somehow relate to the end user; It's not like this.
- "Session" - There is no session on Google Drive, Google may have a session, within which the OAuth flow wants to identify a user to generate an access token for that user. But there is no "session" for the drive, which is why a drive app can access many drive accounts in the form of their choice, provided they have an access token for each.
Comments
Post a Comment