0

I am working on winform application - .Net 4.6

I need to connect to Gmail for accessing the mails. For that I was thinking to have OAuth 2.0 authentication for google account. I did found couple of solutions like Login using Google OAuth 2.0 with C#

But I want to achieve that without user interaction (login details be already provided/stored).

So two questions,

  1. Is ROPC type or by any other authentication flow, Google supports un-interactive authentication?
  2. If so, please guild me how can I achieve that.
Amit
  • 31
  • 6
  • Even when user is already signed-in, the user consent is needed when a new application wants to access the Gmail account of that user. see https://developers.google.com/identity/protocols/oauth2/web-server – Anand Sowmithiran Jul 25 '22 at 11:32
  • @AnandSowmithiran yes, that one time consent giving is still okay for me. but once the consent is given, all subsequent authentication, token fetching, and API calls should be automatic. If that is possible? And I am talking more about a desktop application, which would not share the login session from web browser. – Amit Jul 25 '22 at 11:48
  • I think that should be possible. There are desktop apps, that throw system default browser to get that kind of 'consent' for OAuth/OID purposes. Refer [this](https://developers.google.com/gmail/api/quickstart/dotnet) Google provided sample to know how to access Gmail API from your app. though the example is console app, you may be able to do similar for Winforms. – Anand Sowmithiran Jul 25 '22 at 14:28

0 Answers0