Issue with Role Assignment and Token Permissions on First Login via OIDC Federated Connection (Cross-Tenant Setup)

Hi @preethamgowda,

Welcome to the Auth0 Community and sorry for the delayed response!

You can assign roles to users on their initial login and append them to the Id or Access Token by using a Post-Login Action as described in this community article - Add Roles and Permissions to the ID Token Using Actions.

The changes however will be noticed only on a subsequent login, given the nature of the event object from within the Action. A more detailed explanation can be found from this post - Roles custom claim is empty after roles are set on user creation (via auto-import). So the workaround would be performing a silent authentication request to get the updated token set.

Hope this helps!
Thanks,
Remus