4,815 questions
Hi @Mahantesh Ambiger ,
If you want to add authentication for oauth in asp.net core 6, I suggest you could refer to below cods:
Modify the program.cs:
builder.Services.AddAuthentication().AddOAuth("Oauth", options =>
{
// When a user needs to sign in, they will be redirected to the authorize endpoint
options.AuthorizationEndpoint ="";
// scopes when redirecting to the authorization endpoint
options.Scope.Add("openid");
options.Scope.Add("profile");
options.Scope.Add("email");
options.ClientSecret = "";
});