Skip to content

Commit 64efc80

Browse files
committed
Merge branch 'kathy-update-auth0-rule' into main-stage-13.2.0
2 parents 30c56fc + f2b1689 commit 64efc80

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

docs/HOWTO-configure-auth0.md

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,25 @@ variables.
2121
+ **Allowed Logout URLs** - `https://yourspoke.example.com/logout-callback`
2222
+ **Allowed Origins (CORS)** - `https://yourspoke.example.com`
2323
5. In Advanced Settings, under the OAuth section, turn off 'OIDC Conformant'.
24-
6. Add a [new empty rule](https://manage.auth0.com/#/rules/create) in Auth0:
24+
6. Navigate to [Actions Library](https://manage.auth0.com/#/actions/library).
25+
7. Click "Build Custom".
26+
8. Enter the following fields:
27+
* Name: `Spoke Action`
28+
* Trigger: `Login / Post Login`
29+
* Runtime: `<DEFAULT>`
30+
9. Click "Create".
31+
10. In the code block of the Actions Code Editor, update the `exports.onExecutePostLogin` code as follows:
2532
```javascript
26-
function (user, context, callback) {
27-
context.idToken["https://spoke/user_metadata"] = user.user_metadata;
28-
callback(null, user, context);
29-
}
33+
exports.onExecutePostLogin = async (event, api) => {
34+
api.idToken.setCustomClaim("https://spoke/user_metadata", event.user.user_metadata);
35+
};
3036
```
31-
7. Update the Auth0 [Universal Landing page](https://manage.auth0.com/#/login_page), click on the `Customize Login Page` toggle, and copy and paste following code in the drop down into the `Default Templates` space:
37+
11. Click `Deploy`.
38+
12. Navigate to [Actions Flows](https://manage.auth0.com/#/actions/flows).
39+
13. Click "Login".
40+
14. Add "Spoke Action" to the Login flow.
41+
15. Click "Apply".
42+
16. Update the Auth0 [Universal Landing page](https://manage.auth0.com/#/login_page), click on the `Customize Login Page` toggle, and copy and paste following code in the drop down into the `Default Templates` space:
3243

3344
<details>
3445
<summary>Code to paste into Auth0</summary>
@@ -125,4 +136,4 @@ callback(null, user, context);
125136
```
126137

127138
</details>
128-
8. Replace `YOUR_TOS_LINK_HERE` with the link to your Terms of Service and replace `YOUR_PRIVACY_POLICY_LINK_HERE` with the link to your Privacy Policy
139+
17. Replace `YOUR_TOS_LINK_HERE` with the link to your Terms of Service and replace `YOUR_PRIVACY_POLICY_LINK_HERE` with the link to your Privacy Policy

0 commit comments

Comments
 (0)