This is a simple node app that works along with Auth0 redirect rules to progressivly ask and update user's profile
First, head over to Auth0 documentation to learn about Progressive Profiling
Second, if you are not yet familiar with Auth0's powerful extensibility feature called Rules, then head over to Rules documentation and especially relevant to the topic of progressive profiling, checkout redirect rules.
Finally, checkout redirect rules example here that shows how to put all of these concepts together to implement progressive profiling.
Set up redirect rules as specified in the redirect rules example here Note: You will get UPDATE_PROFILE_WEBSITE_URL
value later once you have deployed this progressive-profile-demo
webapp
Now, this simple node webapp is just a replacement of update-profile-website
webtask implemented here.
- clone this repo
- host this webapp with your choice of server platform that supports nodejs platform (I'll explain below how to set it up with heroku)
- setup environment variables with same names as webtask secrets mentioned here
- make sure you install all the dependencies specified in
package.json
- fire up the server. This should give you a public url of this app that you need to use as a value for
UPDATE_PROFILE_WEBSITE_URL
Pre-requisites: You have heroku account and you have already installed Heroku command line interface Oh and Heroku CLI needs git
so there is that.
- Login to Heroku by running
heroku login
command in your OS terminal - Clone this repo by running
git clone [email protected]:ashishdasnurkar/update-profile-website.git
- Change into repo directory by running
cd update-profile-website
- Now create a Heroku app by running
heroku create
. This will give a random name to your app and set up a git repo within Heroku where you can push the app source code. - Push the app source code to Heroku to deploy it by running
git push heroku master
. This will install all required dependencies on Heroku in order to run the app and once successful, it will spit out the live url for your app. This is the url that you should use forUPDATE_PROFILE_WEBSITE_URL
value in step#5 mentioned in earlier section - To complete the setup all you need to do now is to setup the required environment variables mentioned in step #4 above. You can do so by using Heroku CLI
heroku config:set AUTH0_DOMAIN=YOUR_TENANT_DOMAIN
. HereYOUR_TENANT_DOMAIN
refers to <YOUR_TENANT>.auth0.com or if you are using custom domain then <YOUR_CUSTOM_DOMAIN>
Make sure you understand how the example works
Now, login to your own app (not this one. Or if you are just testing then download one of Auth0 quickstarts) and signup with a new user email & password. After successful signup you should be redirected to this app where you will be prompted to enter your First Name and Family Name. Once you submit the form, the entered first name and family name should be saved in user profile > user metadata (confirm this by going to auth0 dashboard & looking up user profile). The saving/updating user profile is done by continue-from-update-profile-website
rule
On third login, you will be presented to enter your date of birth. One you submit the form, the entereed DOB should be saved in user profile > user metadata (confirm this by going to auth0 dashboard & looking up user profile).
Open an issue or reach out to the friendly Auth0 Community for help.