thank you for helping me out.
I will keep this thread open and get back to you if I need further help.
just to understand, based on this screenshot
I'm doing the following:
please correct me if I'm missing anything
based on the documentation you shared to change the current principal,
how can I create new Current principal with all the values of the existing principal and change only the role.
could you please give me code example based on the screenshot I shared before
I don't understand I'm changing the role with _IdentityUserManager for dynamic claims then I 'm changing current principal to check the permissions.
is there any other way to check the permission without changing the current principal.
thank you for explaining this,
from this, what I understood is that, I should always use _identityUserManager to change any dynamic claim for the current user.
hi,
so far what I have understood is that. if I wanna change the role of the current user (dynamic claim) so I should stick with IdentityUserManager to change the role of the current user, but for other purpose I can use CurrentUser service to read some data about user.
because in my implementation, all I wanna do change the role of the current user based on some conditions.
am I correct ?
lets say If I don't want to change the Current Principal, but the other approach I'm taking to change the role of the user.
is it right approach or is there any better way to solve it.
Hi, I have the following method that I'm using to test the dynamic claims
as you can see I'm changing the role of the current user on the backend.
if I return the first line with CurrentUser.Roles, it still shows old roles, (this means CurrentUser service is not updating with latest data)
but if I return the second line then it return the new roles