vigi
June 15, 2021, 1:33pm
#1
I found this question which is very helpful. Unfortunately they get closed so I can’t simply continue the same discussion.
Hi Auth0 Community!
I’m trying to implement Send Email Invitations for Application Signup , but am confused on a few things.
For context; I am allowing Admin users to create new users using the Management API, using the new user’s email and setting a random password, with the email_verified flag set to false.
I’ve read the docs linked about 42.5 times, and still cannot seem to understand where to go from there. When the user is created, right now, an email is automatically sent for them to ver…
I don’t suppose there is any way to implement this if I am using a different app registration for each tenant in a multitenant environment? The domain, client id, secret and connection are hard coded here. Is there any avenue for making these dynamic? The context seems to have a reference to the connection id. Is there away to get the other info?
Hi @vigi ,
Unfortunately, the client data isn’t available to the post-user registration hook, but instead only the following:
/**
@param {object} user - user being created
@param {string} user.id - user's ID (user GUID without "auth0|" database prefix)
@param {string} user.tenant - Auth0 tenant name
@param {string} user.username - user's username
@param {string} user.email - user's email
@param {boolean} user.emailVerified - indicates whether email is verified
@param {string} user.phoneNumber - user's phone number
@param {boolean} user.phoneNumberVerified - indicates whether phone number is verified
@param {object} user.user_metadata - user's user metadata
@param {object} user.app_metadata - user's application metadata
@param {object} context - Auth0 context info, such as connection
@param {string} context.requestLanguage - language of the application agent
@param {object} context.connection - connection info
@param {object} context.connection.id - connection ID
@param {object} context.connection.name - connection name
@param {object} context.connection.tenant - connection tenant
@param {object} context.webtask - Hook (webtask) context
@param {function} cb - function (error, response)
*/
What you could do is use the Management API’s POST /api/v2/tickets/password-change endpoint and your own email provider to send the password reset link in the email instead (following the guide: https://auth0.com/docs/auth0-email-services/send-email-invitations-for-application-signup ). Unfortunately, there isn’t a way to determine the client at that point in the auth flow otherwise.
system
closed
July 1, 2021, 1:28pm
#4
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.