Added userinfo endpoint usage and api now properly creates necessary claims to start doing database stuff
This commit is contained in:
@@ -36,22 +36,21 @@ namespace Web
|
||||
services.AddAuthentication(options =>
|
||||
{
|
||||
options.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
||||
options.DefaultChallengeScheme = "oidc";
|
||||
options.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
|
||||
})
|
||||
.AddCookie(CookieAuthenticationDefaults.AuthenticationScheme)
|
||||
.AddOpenIdConnect(options =>
|
||||
.AddOpenIdConnect(OpenIdConnectDefaults.AuthenticationScheme,options =>
|
||||
{
|
||||
options.Authority = Configuration["oidc:authority"];
|
||||
options.ClientId = Configuration["oidc:client_id"];
|
||||
options.ClientSecret = Configuration["oidc:client_secret"];
|
||||
|
||||
options.ResponseType = OpenIdConnectResponseType.Code;
|
||||
options.GetClaimsFromUserInfoEndpoint = true;
|
||||
options.GetClaimsFromUserInfoEndpoint = false;
|
||||
options.SaveTokens = true;
|
||||
options.UseTokenLifetime = true;
|
||||
options.Scope.Add("openid");
|
||||
options.Scope.Add("profile");
|
||||
options.Scope.Add("email");
|
||||
options.Scope.Add(OpenIdConnectScope.OpenIdProfile);
|
||||
options.Scope.Add(OpenIdConnectScope.OpenId);
|
||||
options.TokenValidationParameters = new
|
||||
TokenValidationParameters
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user