Hi @rueben.tiow thank you for your response.
With checkSession({ ignoreCache: true }) just log me out and getTokenSilently({ ignoreCache: true }) i get Login required.
First, the Login required error is expected when using the getTokenSilently method when there isn’t an authenticated user. In silent authentication, the “login required” error is thrown when the user’s browser does not or cannot send the “Auth0” cookie. This cookie identifies the user’s logged-in session with Auth0 and resides on the client’s browser.
In this case, you’ll need to initiate the authentication process again.
As for your Rule, it is correct for appending custom claims to tokens and should work.
Please let me know if there’s anything else I can do to help.
I have made an edit to my previous post. The error you have encountered happens because it expects an authenticated user when using the getTokenSilently method.
As a result, you will need to make sure the user is logged in, or you will need to reinitiate the log-in process. Additionally, you might want to avoid the checkSession({ ignoreCache: true }) logging you out preceding the getTokenSIlently method.
Hoped this helps!
Please let me know if there’s anything else I can do to help.