private static String findCurrentClientName ( final J2EContext webContext ) { val pm = new ProfileManager <> ( webContext , webContext . getSessionStore ( ) ) ; val profile = pm . get ( true ) ; return profile . map ( CommonProfile :: getClientName ) . orElse ( null ) ; }
Finds the current client name from the context using the PAC4J Profile Manager . It is assumed that the context has previously been populated with the profile .