Auth0 Home Blog Docs

How to set app_metadata for all identity providers

I have a multi-tenanted SaaS application, and so when a new user is signed up I need to attach the correct Tenant ID to that user.

The app_metadata seems to be the right place to put this, but how can I integrate the code to do so?

Example - User 1 from Tenant A invites a new user (User 2) to join them in their tenant. This sends an invite email to User 2 with a link they can click to sign-up.

Question 1: This link could include the Tenant ID but how would I get Auth0 to read it in as part of the registration page?

Then let’s suppose User B clicks the link, and selects to Login With Facebook.

Question 2: How do I attach the Tenant ID to the app_metadata of the new user at this point?
It seems like the Pre Registration Hook would be the way to do this but the docs say it is only supported for database connections, not for social identity providers?

Hi @chrisj2,

Can you try passing a querystring param to rules and update the metadata there?

Here are some examples and considerations:


Hope this helps!

Thanks,
Dan

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