Hello,
In my setup the API has RBAC enabled as well as Add Permissions in the Access Token.
At the same time there is a conditional MFA rule as following:
I was unable to reproduce this in a lab environment with only that rule enabled; for reference here’s the steps I did:
create a user, API and client application.
enable RBAC in API, set a permission directly to the user and configure user metadata to not request MFA.
login with the user and confirm the permissions are there in the token.
enable MFA in user metadata.
login again with the user.
In the last step I still saw permissions in the access token.
Can you confirm that is the only rule you have enabled in the tenant? If it is not it would be worthwhile to test with all other rules disabled and also provide more information about how you’re performing the login. For example, I used the new universal login experience to complete my test logins.
This rule is the only rule in the tenant. Removing it, brings permissions back into the JWT.
The users in the app are required MFA on a certain condition. The use_mfa flag is set to true when it is required. Type of the flow that is used here is username/password and a DB connection.
Can you share a sample access token for the two scenarios (with rule and without rule)? You can remove the signature part to make the token useless and if you want to go beyond you can just include the JSON payload with redacted personal information.
If you redact information please replace it in a consistent way in both tokens and use equivalent data. For example, if both tokens contains a user email address john.doe@example.com replace it by user@example.com in both.
Thanks for sharing; I confess that I initially assumed only one user was being used for testing this and that the user profile was just updated to toggle MFA on and off, but for the provided tokens the sub claim is different which indicates different users. With different users there’s much more scenarios that could explain the difference in issued token.
Is it possible for you to perform the tests with the same exact user?
@jmangelo I have the same problem. I did it with the same user, and if user logged in without mfa then permissions is presented, but if use mfa - they omitted @alex16 is there a solution to this problem?