简体   繁体   中英

is oAuth possible for C# Windows Application?

I have a windows application, developed in C#. where I need to perform Google oAuth so I'll get their profile. I don't want to ask the user to enter their Google Username and Password in my windows application (and of course users don't want that).

How can I do that ?

I tried 1.) Able to open Google Authentication page from my windows application, but can't figure it out how to get access token passed to my windows application.

Any inputs / suggestions ?

I appreciate this is an old question but I'm currently looking into the same thing. From what I've found, using an embeded webBrowser as per SamFisher83's suggestion is "strongly discouraged".

I thought I'd share this guide from Google themselves.

Link to Google OAuth 2.0 guide

No doubt the OP found a way of doing it, but this was one of the first links that came up via a google search on the subject and thought I'd share the link for any future reference.

What you are probably looking for is called 2-legged OAuth . You can get some example code here , but its in PHP. You can also see a C# Example here

You can have a webBrowser control in you application. You can then let the user log in via the webBrowser control. You can then query the webBrowser control for the data.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM