fix: oauth
This commit is contained in:
@@ -15,8 +15,8 @@ builder.Services.AddAuthentication(options =>
|
|||||||
.AddOpenIdConnect("oidc", options =>
|
.AddOpenIdConnect("oidc", options =>
|
||||||
{
|
{
|
||||||
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
|
||||||
|
|
||||||
|
options.CallbackPath = "/signin-oidc";
|
||||||
|
|
||||||
options.Authority = "https://oauth.e1lama.ru/application/o/asp_net";
|
options.Authority = "https://oauth.e1lama.ru/application/o/asp_net";
|
||||||
options.ClientId = "";
|
options.ClientId = "";
|
||||||
@@ -29,7 +29,7 @@ builder.Services.AddAuthentication(options =>
|
|||||||
options.Scope.Add("profile");
|
options.Scope.Add("profile");
|
||||||
options.Scope.Add("email");
|
options.Scope.Add("email");
|
||||||
|
|
||||||
options.GetClaimsFromUserInfoEndpoint = true;
|
options.GetClaimsFromUserInfoEndpoint = false;
|
||||||
|
|
||||||
options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters
|
options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters
|
||||||
{
|
{
|
||||||
@@ -73,7 +73,7 @@ var summaries = new[]
|
|||||||
|
|
||||||
app.MapGet("/me", (HttpContext ctx) =>
|
app.MapGet("/me", (HttpContext ctx) =>
|
||||||
{
|
{
|
||||||
return ctx.User.Claims.Select(x => (x.Type, x.Value));
|
return ctx.User.Claims.Select(x => $"{x.Type} {x.Value}");
|
||||||
})
|
})
|
||||||
.RequireAuthorization()
|
.RequireAuthorization()
|
||||||
.WithOpenApi();
|
.WithOpenApi();
|
||||||
|
|||||||
Reference in New Issue
Block a user