Member-only story

AWS Cognito — Additional Claims in JWT ID Tokens

Eric Anicet
5 min readDec 4, 2023

--

In this story, we’ll explain how to add custom attributes in the user token AWS Cognito claims using the Pre-Token Generation lambda trigger.

· Prerequisites
· Overview
· Amazon Cognito Setup
· Getting Started
User pool app clients — JSON web tokens
Add a custom claim to a JWT token
· Conclusion
· References
· Additional Readings

Prerequisites

This is the list of all the prerequisites:

  • An active AWS account
  • Basic knowledge of Node.js
  • Basic knowledge of how AWS Cognito works

Overview

Security remains a critical requirement when building an application. AWS Cognito is therefore a service that offers many advantages in the standard management of authentication and authorization for application users.

In many scenarios when using AWS Cognito, we need or want to add additional claims to a token. This becomes particularly useful when additional custom enrichment is not available within standard-created tokens.

--

--

No responses yet