protected Optional<UserProfile> retrieveUserProfileFromToken(final WebContext context, final Token accessToken) {
        val profileDefinition = configuration.getProfileDefinition();
        val profileUrl = profileDefinition.getProfileUrl(accessToken, configuration);
        val service = this.configuration.buildService(context, client);
        val body = sendRequestForData(service, accessToken, profileUrl, profileDefinition.getProfileVerb());
        logger.info("UserProfile: " + body);
        if (body == null) {
            throw new HttpCommunicationException("No data found for accessToken: " + accessToken);
        }
        final UserProfile profile = configuration.getProfileDefinition().extractUserProfile(body);
        addTokenToProfile(profile, accessToken);
        return Optional.of(profile);
    }
Retrieve the user profile from the access token.

@param context the web context
@param accessToken the access token
@return the user profile
pac4j-oauth/src/main/java/org/pac4j/oauth/profile/creator/OAuthProfileCreator.java