In order to use this Auth0 WebTask you simply need to follow these instructions.
You first need to create an Auth0 Client and authorize this client to call the management API;
- Create a new Auth0 Client called "Change Password Service"
- Select the type of the client to be "Non-Interactive"
- On the "quickstart" screen that is show select "Auth0 Management API" in the drop down. This will show a orange box that says "This client is not authorized for this API."
- Click the button that says to "Navigate to the API and Authorize"
- Toggle the "Change Password Service" to authorized.
- Select the scopes
read:users
andupdate:users
- Click "Update"
Now create the webtask:
- Login to https://webtask.io/make
- Create a new webtask and click the settings icon (wrench) to edit the "Secrets". Name your webtask
change-password
- Add three secrets:
AUTH0_DOMAIN
- this is your auth0 account's domain. i.e. myaccount.auth0.comAUTH0_CLIENT_ID
- this is the client_id of the auth0 client you usingAUTH0_CLIENT_SECRET
- this is the client_secret for the client you are using. - Copy the context of the
change_password.js
into your webtask body. - Click Save
- From the bottom left of the page, copy your webtask url. It will look like:
https://wt-1234556.run.webtask.io/change-password
- Use that url from your application to post the change password data. The request is in the format shown below:
METHOD: POST
URL: https://wt-YOURWEBTASK.run.webtask.io/change-password
BODY:
{
"connection": "Username-Password-Authentication",
"username": "test@example.com",
"old_password": "test",
"new_password": "test1"
}
The username
is the email address of the user. The connection
is the name of the Auth0 DB connection you are using. The value shown is the default.