user1551454
user1551454

Reputation: 151

reciving an access token google drive api, c#

I am developing desktop application using Google drive api. I am using c#. at login stage, after login and allow access, I receive authorization code, asking for me to copy paste it to my application for exchanging the authorization code to access token. Is there another way to receive the access token without the user copy and paste the authorization code.

Thank in advance Moran

Upvotes: 2

Views: 748

Answers (1)

Alain
Alain

Reputation: 6034

For desktop applications, the other alternative is to have your application host a temporary web server and set the redirect_uri to localhost:<PORT>. Once the user approves access, the authorization server will redirect to this URI: your application will have to handle the request, parse the ?code= query parameter and exchange it for OAuth 2.0 credentials.

Upvotes: 4

Related Questions