#json #authentication #postman #gmail-api #core
Вопрос:
я хочу использовать OAuth 2.0 в assp.net ядро 3.1, но у меня проблема с моим кодом в обслуживании:
public object GetOuath()
{
string[] scopes = new string[] {
"https://www.googleapis.com/auth/gmail.settings.basic",
"https://mail.google.com/"
};
UserCredential credential = GoogleWebAuthorizationBroker.AuthorizeAsync(
new ClientSecrets
{
ClientId = "693426612910-h0q09satea39jgce8btnag6ftaaoaqjo.apps.googleusercontent.com",
ClientSecret = "aWQszaJ291eZth51QLteZ4iu"
},
scopes,
"user",
CancellationToken.None).Resu<
в запуске:
services.AddAuthentication()
.AddGoogle(options =>
{
options.ClientId = "693426612910-h0q08satea39jgce8btnag6ftaaoaqjo.apps.googleusercontent.com";
options.ClientSecret = "aWQszaJ298eZth51QLteZ4iu";
});