2
Guys is there any way I can generate a token through a Webrequest? Because every time I use the Google Drive function I need to open the authentication page only to generate the Access Token, there is some way I can do this by Webrequest?
2
Guys is there any way I can generate a token through a Webrequest? Because every time I use the Google Drive function I need to open the authentication page only to generate the Access Token, there is some way I can do this by Webrequest?
1
var clientrest = new RestClient(baseUrl);
var requestToken = new RestRequest("oauth/token", Method.POST);
requestToken.AddParameter("grant_type", "password");
requestToken.AddParameter("username", model.Login);
requestToken.AddParameter("password", model.Senha);
var responseToken = clientrest.Execute<TokenViewModel>(requestToken);
responseToken.Data.access_token; // acesso ao token
used restsharp https://www.nuget.org/packages/RestSharp
Browser other questions tagged c# asp.net-mvc oauth2 token
You are not signed in. Login or sign up in order to post.
this "client" would be what?
– Brayan
ignore was error at the time of paste I already edited
– Eduardo Sampaio