protected JWTClaimsSet buildJwtClaimsSet(final UserProfile profile) {
        // claims builder with subject and issue time
        val builder = new JWTClaimsSet.Builder()
                .issueTime(new Date());

        if (this.expirationTime != null) {
            builder.expirationTime(this.expirationTime);
        }

        // add attributes
        val attributes = profile.getAttributes();
        for (val entry : attributes.entrySet()) {
            builder.claim(entry.getKey(), entry.getValue());
        }
        builder.claim(INTERNAL_ROLES, profile.getRoles());
        builder.claim(INTERNAL_LINKEDID, profile.getLinkedId());

        builder.subject(profile.getTypedId());

        // claims
        return builder.build();
    }
<p>buildJwtClaimsSet.</p>

@param profile a {@link UserProfile} object
@return a {@link JWTClaimsSet} object
pac4j-jwt/src/main/java/org/pac4j/jwt/profile/JwtGenerator.java