Layer 7 API Management: Custom claim support for ID Tokens

book

Article ID: 17202

calendar_today

Updated On:

Products

STARTER PACK-7 CA API Gateway

Issue/Introduction

How can custom claims be added to an ID Token?

Environment

GATEWAY 9.x, 10

OTK 4.x

 

Resolution

As of the OAuth Toolkit (OTK) 4.2 we do not currently support the addition of custom claims within an ID token. If needed you can however add additional details to the JSON Web Token (JWT) header.

For example, if you would like to add the below to your ID Token follow these steps:

{

 "customValue1":"abc",

 "customValue2":"xyx"

}

 

1. Create a context variable of type string containing the JSON formatted data you wish to add

2. Generate an ID Token using the 'Generate ID Token' assertion

 

3. Encode the ID Token as a JWT using the 'Encode Json Web Token' assertion. Select the option 'Merge to Generated Header' option and specify the context variable we created above for the value.

 

The result will now include the custom values in the JWT header: 

 

Attachments

1558719253012000017202_sktwi1f5rjvs16v8x.png get_app
1558719250962000017202_sktwi1f5rjvs16v8w.png get_app
1558719249061000017202_sktwi1f5rjvs16v8v.png get_app
1558719247162000017202_sktwi1f5rjvs16v8u.png get_app