Extend the sample Express app
On This Page
The following code extends the local sample Node.js Express application to display the results of the Token Inline Hook claim addition. This step is optional. The Token Inline Hook is functional and the results of the implementation are available in the external service logs, as well as the System Log on your Okta org. But this extension is nice to have!
To extend the local sample Node.js Express application, you need to update the
- Navigate to your project folder
samples-nodejs-express-4and continue to the
- In an editor, open the
- Locate the routing function
app.get('/profile'and modify the function as in the code below. The Inline Token Hook code extension appears after the
constdeclarations and before the
This extension renders the ID token, and if it contains the claim added by the Token Inline Hook, adds this claim to the attributes array. This array displays claims on the user's My Profile page.