From 9c4e16bba1f88f5d3426b5d7e5f88aed73dd2f86 Mon Sep 17 00:00:00 2001 From: HiveBeats Date: Mon, 14 Oct 2024 00:29:53 +0700 Subject: [PATCH] fix: oauth --- OAuth.Authentik/Program.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/OAuth.Authentik/Program.cs b/OAuth.Authentik/Program.cs index 630092c..d7918ec 100644 --- a/OAuth.Authentik/Program.cs +++ b/OAuth.Authentik/Program.cs @@ -15,8 +15,8 @@ builder.Services.AddAuthentication(options => .AddOpenIdConnect("oidc", options => { options.SignInScheme = CookieAuthenticationDefaults.AuthenticationScheme; - - + + options.CallbackPath = "/signin-oidc"; options.Authority = "https://oauth.e1lama.ru/application/o/asp_net"; options.ClientId = ""; @@ -29,7 +29,7 @@ builder.Services.AddAuthentication(options => options.Scope.Add("profile"); options.Scope.Add("email"); - options.GetClaimsFromUserInfoEndpoint = true; + options.GetClaimsFromUserInfoEndpoint = false; options.TokenValidationParameters = new Microsoft.IdentityModel.Tokens.TokenValidationParameters { @@ -73,7 +73,7 @@ var summaries = new[] 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() .WithOpenApi();