public static void populateAuthentication ( final LinkedHashMap < String , CommonProfile > profiles ) { if ( profiles != null && profiles . size ( ) > 0 ) { final List < CommonProfile > listProfiles = ProfileHelper . flatIntoAProfileList ( profiles ) ; try { if ( IS_FULLY_AUTHENTICATED_AUTHORIZER . isAuthorized ( null , listProfiles ) ) { SecurityContextHolder . getContext ( ) . setAuthentication ( new Pac4jAuthenticationToken ( listProfiles ) ) ; } else if ( IS_REMEMBERED_AUTHORIZER . isAuthorized ( null , listProfiles ) ) { SecurityContextHolder . getContext ( ) . setAuthentication ( new Pac4jRememberMeAuthenticationToken ( listProfiles ) ) ; } } catch ( final HttpAction e ) { throw new TechnicalException ( e ) ; } } }
Populate the authenticated user profiles in the Spring Security context .