Closed
Description
The methods in ClaimAccessor
attempt to coerce a mapped value of Object
to a specific type, for example:
getClaimAsBoolean
getClaimAsInstant
getClaimAsURL
The coercion happens on each get
which is not ideal. It would be more efficient if the coercion happened once and before the Map<String, Object>
of claims is associated to the specific type of ClaimAccessor
implementation at construction time. This change would apply to OidcIdToken
, OidcUserInfo
, and Jwt
.
This capability is already implemented by MappedJwtClaimSetConverter
, which is used by NimbusJwtDecoder
to normalize the claims before it's associated to the Jwt
.
We should reuse/share the logic in MappedJwtClaimSetConverter
as part of this task. For example, the Converter
implementations in MappedJwtClaimSetConverter
should be reused.