mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-29 09:18:13 +08:00
fix: fix bug in jwt config
This commit is contained in:
parent
c9b1767b41
commit
ab579347c6
@ -48,20 +48,13 @@ public static class JwtExtensions
|
|||||||
.RequireAuthenticatedUser()
|
.RequireAuthenticatedUser()
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
// Add your scope policy (optional)
|
options.AddPolicy(
|
||||||
if (!string.IsNullOrEmpty(jwtOptions.Audience))
|
nameof(ApiScope),
|
||||||
{
|
policy =>
|
||||||
options.AddPolicy(
|
{
|
||||||
nameof(ApiScope),
|
policy.RequireAuthenticatedUser();
|
||||||
policy =>
|
policy.RequireClaim("scope", jwtOptions.Audience);
|
||||||
{
|
});
|
||||||
policy.AuthenticationSchemes.Add(
|
|
||||||
JwtBearerDefaults.AuthenticationScheme);
|
|
||||||
|
|
||||||
policy.RequireAuthenticatedUser();
|
|
||||||
policy.RequireClaim("scope", jwtOptions.Audience);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user