testuser
testuser

Reputation: 678

Google Oauth2.0 authentication in a console application

I am trying to use Google shopping API. In order to use the API, my application should be authenticated using OAuth2.0. Looks like this method involves user interaction (where user allows the application to access the resource) Is it possible to do OAuth authorization in non web applications with no user interaction?

Upvotes: 3

Views: 5082

Answers (1)

Jason Hall
Jason Hall

Reputation: 20920

This may be a good case for using a Service Account. This would mean that your application isn't running as a user but as itself. That is, as a made up account corresponding to your APIs Console project.

Various official client libraries support the Service Account flow as described in the link above, but C# is not listed among them, so you may have to write it yourself. (Though this issue claims it's supported in the google-api-dotnet-client library, I couldn't find the source for this feature after a minute or two of looking).

Upvotes: 1

Related Questions