Lately I’ve been playing around with Auth0.
I’ve managed to setup a custom action that generates an UUID and saves that to the user’s app_metadata. However, this only works with regular user signups, not with SSO.
As @rueben.tiow said in his post. The only trigger that works is the login trigger.
To come to my question: I’m looking for a solution to generate an UUID for all users, including SSO logins. Is this possible?
Edit: So appearently legacy rules do seem to work with SSO. With some help of @markd 's rules i’ve managed to get it working.
I assume these rules will be deprected someday, would I be able to replace this with actions in some way?
I’m glad to hear that you found a workaround using Rules and wanted to know more about the deprecation of Rules.
Yes, you are encouraged to convert your Rules into Actions if possible. At this time, we will continue to support Auth0 Rules until 2022.
Since long-term support for Node 12 will be ending in April 2022, we strongly recommend you begin to migrate to Auth0 Actions, which will allow you to stay on a supported Node version without additional future action or overhead. Note that we do not expect any replacement strategies to emerge until 2022.
For now, I can confirm that it’s safe to continue using Rules until the time comes for the migration.
By which point, you should have ample time to convert your Rules into Actions with the provided migration strategies.
Lastly, If you would like, I would be happy to look at your Rule and see if we can convert it into an Auth0 Action.
In these Action scripts, I also did not implement an unnecessary line of code for setting the app_metadata to itself, but is never used: user.app_metadata = user.app_metadata || {};
I have just tested these Action scripts myself and confirm that they work.
Yes, this will work with SSO. These Action scripts will assign a UUID to a user logging in with any type of Connection such as Social Logins (Facebook, Google, etc) or Database Logins.
Please let me know if there’s anything else I can do to help.