Ah, I just tested this out and if you don't need it in the JWT, you should be able to see it in the registrations object returned after login.
Here's a response I get after logging in:
{
"token": "ey...",
"user": {
"active": true,
"connectorId": "e3306678-a53a-4964-9040-1c96f36dda72",
"email": "email@example.com",
"id": "2df13f18-01cc-48a4-b97a-2ab04f98d006",
"insertInstant": 1592857899119,
"lastLoginInstant": 1596819645662,
"lastUpdateInstant": 0,
"passwordChangeRequired": false,
"passwordLastUpdateInstant": 1592857899145,
"registrations": [
{
"applicationId": "78bd26e9-51de-4af8-baf4-914ea5825355",
"id": "73d2317b-d196-4315-aba2-3c205ed3ccae",
"insertInstant": 1592857899151,
"lastLoginInstant": 1592857899153,
"lastUpdateInstant": 1596813810104,
"roles": [
"Role1"
],
"usernameStatus": "ACTIVE",
"verified": true
}
],
"tenantId": "1de156c2-2daa-a285-0c59-b52f9106d4e4",
"twoFactorDelivery": "None",
"twoFactorEnabled": false,
"usernameStatus": "ACTIVE",
"verified": true
}
}
So user.applicationId.roles is what you want. Note that roles are applied on an application by application basis. If a user is in a group which has a role 'roleA' which is created in 'applicationA', but is not registered for 'applicationA', they won't receive that role. More on that here: https://fusionauth.io/docs/v1/tech/core-concepts/groups