jwt improvements

This commit is contained in:
Shaun Walker
2022-03-29 08:15:13 -04:00
parent a97af42e4b
commit b7a1d2df75
3 changed files with 18 additions and 12 deletions

View File

@ -32,10 +32,10 @@ namespace Oqtane.Infrastructure
var jwtManager = context.RequestServices.GetService(typeof(IJwtManager)) as IJwtManager;
var token = context.Request.Headers["Authorization"].First().Split(" ").Last();
var user = jwtManager.ValidateToken(token, secret);
var user = jwtManager.ValidateToken(token, secret, "", "");
if (user != null)
{
// populate principal
// populate principal (reload user roles to ensure most accurate permission assigments)
var _userRoles = context.RequestServices.GetService(typeof(IUserRoleRepository)) as IUserRoleRepository;
var principal = (ClaimsIdentity)context.User.Identity;
UserSecurity.ResetClaimsIdentity(principal);