Adding claims to an ID token


This article explains how to add arbitrary claims to an ID token.

Adding claims

Authlete's /auth/authorization/issue API is the method for adding claims. In this article, the following claims are to be added.
"Test User"

claims is the paramater to add claims. The request will be constructed as follows. (folded for readability)

curl -s -X POST \
-u '<API Key>:<API Secret>' \
-H 'Content-Type: application/json' \
-d '{ "ticket": "<Ticket>", "subject": "testuser01",
 "claims": "{\"name\": \"Test User\",
  \"email\": \"\",
  \"email_verified\": true}"

Authlete will issue an ID token including the claims in accordance with the request above. The payload part of the ID token is as follows:

  "name": "Test User",
  "email": "",
  "email_verified": true,
  "iss": "",
  "sub": "testuser01",
  "aud": [
  "exp": 1559137301,
  "iat": 1559050901,
  "nonce": "n-0S6_WzA2Mj"
How did we do with this article?