how to add Oauth2 to rest api or graphql in dotnet? *not MVC.
builder.Services.AddAuthentication(opt =>
{
opt.DefaultAuthenticateScheme =JwtBearerDefaults.AuthenticationScheme;
opt.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme;
})
.AddGoogle(opt =>
{
opt.ClientId = builder.Configuration["Authentication:Google:ClientId"];
opt.ClientSecret = builder.Configuration["Authentication:Google:ClientSecret"];
})
is this only for mvc?
and I don't understand what ProviderKey in aspnetuserlogins table mean....
please answer me how to add oauth2 in dotent rest api or graphql.