mirror of
https://github.com/meysamhadeli/booking-microservices.git
synced 2026-04-10 17:59:38 +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()
|
||||
.Build();
|
||||
|
||||
// Add your scope policy (optional)
|
||||
if (!string.IsNullOrEmpty(jwtOptions.Audience))
|
||||
{
|
||||
options.AddPolicy(
|
||||
nameof(ApiScope),
|
||||
policy =>
|
||||
{
|
||||
policy.AuthenticationSchemes.Add(
|
||||
JwtBearerDefaults.AuthenticationScheme);
|
||||
|
||||
policy.RequireAuthenticatedUser();
|
||||
policy.RequireClaim("scope", jwtOptions.Audience);
|
||||
});
|
||||
}
|
||||
options.AddPolicy(
|
||||
nameof(ApiScope),
|
||||
policy =>
|
||||
{
|
||||
policy.RequireAuthenticatedUser();
|
||||
policy.RequireClaim("scope", jwtOptions.Audience);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user