protected Map<String, Object> buildClaimsFromAuthentication(final Authentication authentication) {
        val claimsMap = new HashMap<String, Object>();
        claimsMap.putAll(authentication.getAttributes());
        claimsMap.putAll(authentication.getPrincipal().getAttributes());
        claimsMap.put(OAuth20Constants.CLAIM_SUB, authentication.getPrincipal().getId());
        return claimsMap;
    }
This is {@link DefaultAuthorizationPrincipalParser}.

@author Misagh Moayyed
@since 7.2.0
support/cas-server-support-heimdall/src/main/java/org/apereo/cas/heimdall/engine/DefaultAuthorizationPrincipalParser.java