Authority url validator

This commit is contained in:
Amelia 2025-06-30 14:33:10 +02:00
parent 5480df4cfb
commit 1180d518a2
No known key found for this signature in database
GPG key ID: D6D0ECE365407EAA
9 changed files with 103 additions and 16 deletions

View file

@ -141,7 +141,7 @@ public static class IdentityServiceExtensions
options.Events = new JwtBearerEvents
{
OnMessageReceived = SetTokenFromQuery
OnMessageReceived = SetTokenFromQuery,
};
});
@ -164,8 +164,12 @@ public static class IdentityServiceExtensions
if (ctx.Principal == null) return;
var user = await oidcService.LoginOrCreate(ctx.Principal);
if (user == null) return;
if (user == null)
{
ctx.Principal = null;
await ctx.HttpContext.SignOutAsync(OpenIdConnect);
return;
}
var claims = new List<Claim>
{