Edi
Edi

Reputation: 109

Use DotNetOpenAuth to authenticate for Google Drive SDK

I have used ASP.NET simple membership database with DotNetOpenOAuth to login to my ASP.NET MVC application. I want to use the same authentication credentials to authenticate for using Google Drive app. Namely, can I use AuthenticationResult object details to build IAuthenticator object for authenticating into my Google Drive app?

My aim is to use the already signed-in Google user for later authorizing to use my Google Drive App and not asking him/her again for credentials.

Upvotes: 1

Views: 474

Answers (1)

Burcu Dogan
Burcu Dogan

Reputation: 9213

In order to get authorized and authenticated to a Drive backend, you need to retrieve and persist and access token to append it to each request you make. The typical flow for a system that already implements an auth layer is:

  • Authenticate user
  • Connect your user to a Google Drive account by following the auth steps explained on [1].
  • Persist the access token, refresh token for the user.
  • Authenticate each request you're making on the behalf of the user with his/her access token.

[1] https://developers.google.com/drive/about-auth

Upvotes: 1

Related Questions