Add user from Enterprise Identity Provider

Can I add a user using the Auth0 Dashboard when the user belongs to an AAD Enterprise Connection? I’d like to pre-add the user so that I can set them up with relevant app_metadata values.

Hi @slicc,

The create user feature only works for DB connections. You can add a rule that checks for the user and adds the metadata that way.

Hope this helps,
Dan

The metadata is user specific, the rule isn’t going to know what metadata to add. I guess this means I’d need to create a rule that calls an API that we are hosting to get the relevant user specific data?

I don’t suppose there is a way to store the data within Auth0 somewhere and have the rule look up the values from there?

If you are only calling the API on first login that would not be a problem at all, this is fairly typical. Typically you wouldn’t want to make an external API call every authentication, it can make login feel slow, but it is certainly possible.

Here is an example rule showing how to add a role from an SQL server:

You could add it to the user’s metadata, then add it to the token in a seperate rule (you may need to add it manually the first time).

Does that make sense?

Hopefully this helps!

Yes that’s fine.

Thanks

1 Like

Thanks for following up! Let us know if you have any other questions.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.