public void setAccessToken(final AccessToken accessToken) {
        if (accessToken != null) {
            val accessTokenBase64 = Base64.getEncoder().encodeToString(
                accessToken.toJSONString().getBytes(StandardCharsets.UTF_8));
            addAttribute(OidcProfileDefinition.ACCESS_TOKEN, accessTokenBase64);
            if (accessToken.getLifetime() != 0) {
                setExpiration(Date.from(Instant.now().plusSeconds(accessToken.getLifetime())));
            } else {
                Date exp = null;
                try {
                    val jwtClaimsSet = JWTParser.parse(accessToken.getValue()).getJWTClaimsSet();
                    if (jwtClaimsSet != null) {
                        exp = jwtClaimsSet.getExpirationTime();
                    }
                } catch (ParseException e) {
                    logger.trace(e.getMessage(), e);
                }
                setExpiration(exp);
            }
        }
    }
<p>This class is the user profile for sites using OpenID Connect protocol.</p>
<p>It is returned by the {@link org.pac4j.oidc.client.OidcClient}.</p>

@author Michael Remond
@version 1.7.0
pac4j-oidc/src/main/java/org/pac4j/oidc/profile/OidcProfile.java