aamplugin/advanced-access-manager

Add `roles` claim to the issued JWT token

Closed this issue · 1 comments

In AAM 6.4.x the JWT claims are following:

{
  "iat": 1587498175,
  "iss": "http://dev.wordpress",
  "exp": 1587584532,
  "jti": "73fb9130-330c-4769-a462-f7d89cc7a695",
  "userId": 8,
  "revocable": true,
  "refreshable": false,
  "trigger": {
    "action": "lock"
  }
}

It appears that have also an array of user roles is a useful claim to have (if requested).

The wp-json/aam/v2/authenticate now accepts additional boolean flag includeRoles that will include array of user roles in claims if is set to true.