Hi @p.friedrich,
I am unsure what might be causing the token to lose custom claims after 2-4 days. I recommend reviewing your tenant logs and the user’s profile to ensure that the data is still in user_metadata
and that successful logins are reflected. Also, check the action tab in the successful login logs to verify if the action scripts executed properly.
Additionally, your post-login action script might need to use namespaced custom claims for them to be properly added. This could be the issue with the custom claims not persisting.
Please refer to our Adding custom claims to tokens knowledge solution.
Thanks,
Rueben