protected UserProfile getCurrentProfile(final HttpServletRequest request, final HttpServletResponse response) {
        val ctx = new JEEContext(request, response);
        val manager = new ProfileManager(ctx, oauthDistributedSessionStore);
        val userProfileResult = manager.getProfile();
        if (userProfileResult.isEmpty()) {
            LOGGER.info("Unable to determine the user profile from the context");
            return null;
        }
        return userProfileResult.get();
    }
Gets current profile.

@param request  the request
@param response the response
@return the current profile
support/cas-server-support-oauth-uma/src/test/java/org/apereo/cas/uma/web/controllers/BaseUmaEndpointControllerTests.java