ID Token with customer integer attribute value 1 serialized to "true" (cas 6.4.4)

12 views
Skip to first unread message

Frey R. Funden

unread,
Mar 16, 2022, 5:28:35 AM3/16/22
to CAS Community
Hi,

I am producing a custom attribute (claim) to go into the OAuth ID token, my implementation of the AbstractUsernamePasswordAuthenticationHandler.authenticate() method

Integer accountId = 1; // queried from DB by username
Map<String, List<Object>> attributes = new HashMap<>();
...
attributes.put("account_id", Collections.singletonList(accountId));
...
return createHandlerResult(credential, this.principalFactory.createPrincipal(realUserName, attributes), Collections.emptyList());

The resultant ID token contains then wrong "account_id" : "true"
rather than the expected "account_id" : 1

This works fine however for accountId = 2.

Is this a known bug?

thanks, /f
Reply all
Reply to author
Forward
0 new messages