Continuing the discussion from How do I add a default role to a new user on first login? :
Following this discussion, I implemented the rule to add the default role.
This will however only add the granted permissions when the user logs in a second time.
How can I make sure that the user gets his role & permissions even in the first logins token?
2 Likes
I have the same problem. Have you found a solution yet?
Iāve found an ugly hack, but not really a solution: The client has to immediately refresh on first login. The second token will be correct.
Iām also looking for a solution that will include the permissions in the access token on first login without forcing the client to refresh the access token. @dan.woda Are you able to assist and update the FAQ ?
There are several threads on this topic with no clear answer:
Hi,
I implemented a Login script that retrieves from a legacy database all the information related to users (name, emailā¦), including Roles.
I would like to assign those Roles to the user in the moment it is migrated, so when the Token is generated it will include the permissions for the predefined Role.
Can I assign the Roles on the Login Script? If so, can you provide an example.
If it is not possible. What other option do I have to accomplish this?
Thanks,
I have an application whose end users I like to store in Auth0 āDatabaseā connection.
I want to have end users credentials (username + password) to authenticate them with Auth0. On Successful login, I want Auth0 to return an id_token which has a user role, permissions. Also, I want to know how I can I set these roles and permissions when a user signsup?
@gil.edelman ,
You will have to force a token refresh on first login to get the roleās permissions in the AT. You should be able to do this silently without the user providing credentials.
system
Closed
February 3, 2021, 5:23pm
6
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.