Answer the question
In order to leave comments, you need to log in
Is OAuth 2.0 authorization possible without a browser?
Good evening. Please tell me how it is possible, and is it possible, to log in via OAuth 2.0 from a client application (WinForms, you can also use WPF) without using a browser, but using a previously entered login and password?
Answer the question
In order to leave comments, you need to log in
The provider may allow the user to accept a username and password and convert them into an access token ( accsss token ). But, as a rule, for security reasons, no one gives such an opportunity.
Try it: if grant_type is password , then user data can be passed in the username and password parameters when obtaining an access token. Or use grant_type equal to client_credentials , then the user data should be passed in the Authorization HTTP header (when using HTTPS , this is a more secure method than password).
For example, if Facebook allowed this, then the access token request could be:
https://graph.facebook.com/oauth/access_token?client_id=123&client_secret=abc&
grant_type=password&username=pupkin&password=000
var client = new InstagramClient
(
"9fcad1f7740b4b66ba9a0357eb9b7dda",
"3f04cbf48f194739a10d4911c93dcece"
);
client.ReturnUrl = "http://oauthproxy.nemiro.net/";
client.Username = "aleksey";
client.Password = "Frif#dser#[email protected]";
var accessToken = client.AccessToken;
var client = new FacebookClient("1435890426686808", "c6057dfae399beee9e8dc46a4182e8fd");
client.Username = "aleksey";
client.Password = "a6lGmDZsCb1SuHsIQw89ZqK9";
var accessToken = client.AccessToken;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question