public UserProfile getAuthenticatedUserProfile(final WebContext context, final SessionStore sessionStore) {
        val manager = new ProfileManager(context, sessionStore);
        val profile = manager.getProfile();
        return profile.orElseThrow(() -> new IllegalArgumentException("Unable to determine the user profile from the context"));
    }
Gets authenticated user profile.

@param context      the context
@param sessionStore the session store
@return the authenticated user profile
support/cas-server-support-oauth-core-api/src/main/java/org/apereo/cas/support/oauth/util/OAuth20Utils.java