# Custom invitation flow

**URL:** <https://community.auth0.com/t/custom-invitation-flow/80464>\
**Category:** Get Help\
**Tags:** invitations, hosted-pages, auth0\
**Created:** [March 24, 2022, 12:31pm UTC](https://community.auth0.com/t/custom-invitation-flow/80464 "2022-03-24T12:31:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tal.sh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tal.sh/32/36129_2.png) [@tal.sh](https://community.auth0.com/u/tal.sh)\
**Post date:** [March 24, 2022, 12:31pm UTC](https://community.auth0.com/t/custom-invitation-flow/80464/1 "2022-03-24T12:31:15Z")

</div>

Hello,  
I want to create the following invitation flow in my application:

- Admin invite user by email
- The user gets an email with a link to set up his account (the link can be used only once)
- When the user clicks on the link, he will be redirected to a form hosted in OUR website.
- The user will fill the following data in the form:
  - First name
  - last name
  - new password

- In the next page (still on our website), the user will be required to supply phone number for MFA purposes. He will get an SMS OTP and will be required to provide it back.
- After completing all steps above, the user is redirected to login / automatically logged in to our application.

I followed some of the guides in the docs:

- [Send Email Invitations for Application Signup](https://auth0.com/docs/customize/email/send-email-invitations-for-application-signup)
- [Customize Password Reset Page](https://auth0.com/docs/customize/universal-login-pages/customize-password-reset-page)

But I still having a trouble to understand how to achieve my flow…  
I figured that I will probably have to use the Auth0 authentication/management API directly… but I don׳t know how exactly…

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [March 25, 2022, 2:54pm UTC](https://community.auth0.com/t/custom-invitation-flow/80464/2 "2022-03-25T14:54:27Z")

</div>

Hi @tal.sh

You can do this, but there are a couple of issues: the password and SMS registration is better hosted by Auth0 instead of your website.

If you want to do it, you’ll need the management API to create the account, and the MFA API to register the SMS. The user will have to log in (they will not be logged in automatically) at the end of the process.

A different approach:

- Send the link via email
- The link connects to your webpage
- Your webpage gathers first/last name and creates the account
- Your webpage gets a password reset ticket (from the mgmt API)
- Your webpage redirects to the password reset ticket
- User enters password
- After success, user is redirected to a login page
- User logs in with new password
- MFA enrollment happens.

John

---

<div class="post-metadata">

**Author:** ![tal.sh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tal.sh/32/36129_2.png) [@tal.sh](https://community.auth0.com/u/tal.sh)\
**Post date:** [March 26, 2022, 8:41am UTC](https://community.auth0.com/t/custom-invitation-flow/80464/3 "2022-03-26T08:41:10Z")

</div>

Hi @john.gateley

Thank you so much for you answer!

I have some questions regarding your suggested flow:

- Send the link via email
  - You mean, link to our site? so our backend should generate and sent it (without auth0 involvement )? if so I will need to take care of invalidating the link after fist use…

- The link connects to your webpage
- Your webpage gathers first/last name and creates the account —
  - The “webpage” is actually a web-app, which is an “application” in auth0. isn’t it a bad practice that an application is using the mngmnt API (I touth that application should only use auth API and services like our backend should use the mngmnt API)
  - If the link only link to our site, how should I “connect” the invited user with the user that is using this page? how should I prevent anyone from just hitting that page and creating himself a user? (we are talking about invitation and not sign-up…)

- Your webpage gets a password reset ticket (from the mgmt API)
- Your webpage redirects to the password reset ticket
- User enters password
- After success, user is redirected to a login page
- User logs in with new password
- MFA enrollment happens.

In addition, Now my flow is implemented by following of this guild:

> **[Send Email Invitations for Application Signup](https://auth0.com/docs/customize/email/send-email-invitations-for-application-signup)**
>
> Describes how to customize the signup process to invite users to signup for an account in the context of a specific Auth0 application.

- When user invited our BE use the mngmnt API to create the user and trigger a change Password Email
- The user change his password from the link in the mail. after changing the user is redirected to our login page
- after login MFA enrollment happens automatically.

It works, BUT the only step “missing” is the collection of some user details (like first/last name) before/after changing his password.

If I׳m willing to use ONLY auth0 hosted pages, is there any way to achieve my goal? by customizing the change password page?(so that it will be asking the user for his details…) or with flows/actions/hooks?

Thanks again for you help

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [March 28, 2022, 2:09pm UTC](https://community.auth0.com/t/custom-invitation-flow/80464/4 "2022-03-28T14:09:48Z")

</div>

Hi @tal.sh

Perhaps the best approach is “progressive profiling”. Do the flow you mentioned to invite new users and change their passwords, using Auth0, and then have a redirect action to gather their first and last names. You would host the page gathering the name info.

> **[Redirect with Actions](https://auth0.com/docs/customize/actions/flows-and-triggers/login-flow/redirect-with-actions)**
>
> Learn how to use post-login Actions to redirect users before an authentication transaction is complete.

(you can also do this with rules).

If you go with the approach I first suggested, which is more complex, then you will have to keep track of link usage, and you will have to ensure you call the management API from your webapp’s secure back end, not the front end.

John

---

<div class="post-metadata">

**Author:** ![tal.sh](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/tal.sh/32/36129_2.png) [@tal.sh](https://community.auth0.com/u/tal.sh)\
**Post date:** [March 29, 2022, 10:35am UTC](https://community.auth0.com/t/custom-invitation-flow/80464/5 "2022-03-29T10:35:05Z")

</div>

Hi @john.gateley,  
Thanks for your answer.  
I think thats the way to go in my case.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 29, 2022, 4:07pm UTC](https://community.auth0.com/t/custom-invitation-flow/80464/6 "2022-03-29T16:07:54Z")

</div>

We are here for you @tal.sh !

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [March 31, 2022, 10:33am UTC](https://community.auth0.com/t/custom-invitation-flow/80464/7 "2022-03-31T10:33:06Z")

</div>



---

<div class="post-metadata">

**Author:** ![dawid.matuszczyk](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dawid.matuszczyk/32/74550_2.png) [@dawid.matuszczyk](https://community.auth0.com/u/dawid.matuszczyk)\
**Post date:** [May 14, 2024, 2:03pm UTC](https://community.auth0.com/t/custom-invitation-flow/80464/8 "2024-05-14T14:03:55Z")

</div>

Hey team!

This topic seems related to our new EA feature, Forms for Actions, which rolled out of the beta stage on May 7th. Our Product team prepared the whole Documentation page with examples of Use cases. [Forms for Actions](https://auth0.com/docs/customize/forms). If you find yourself having questions regarding this new feature for the next two weeks, we are hosting an [Ask Me Anything session](https://community.auth0.com/t/auth0-community-ask-me-anything-customize-and-extend-ciam-with-new-forms-for-actions/133516). Our Product Expert will provide comprehensive written answers on May 21st from 8 AM to 10 AM PST.  
Find out more about [Forms for Actions](https://auth0.com/docs/customize/forms) and [learn more about AMA](https://community.auth0.com/t/auth0-community-ask-me-anything-customize-and-extend-ciam-with-new-forms-for-actions/133516).

Thanks!  
Dawid
