in src/main/java/org/apache/directory/fortress/web/control/SecUtils.java [224:254]
public static void initializeSession(Component component, J2eePolicyMgr j2eePolicyMgr, AccessMgr accessMgr, String szPrincipal ) throws SecurityException
{
Session realmSession = null;
if(j2eePolicyMgr == null || accessMgr == null)
{
throw new SecurityException( GlobalIds.SESSION_INITIALIZATION_FAILED, "initializeSession failed - verify the injection of fortress spring beans into your application" );
}
try
{
if( StringUtils.isNotEmpty( szPrincipal ))
realmSession = j2eePolicyMgr.deserialize( szPrincipal );
}
catch( SecurityException se )
{
throw new RuntimeException( se );
}
if(realmSession != null)
{
synchronized ( ( WicketSession ) WicketSession.get() )
{
if ( SecUtils.getSession( component ) == null )
{
LOG.info( "realmSession user: " + realmSession.getUserId() );
// Retrieve user permissions and attach RBAC session to Wicket session:
( ( WicketSession ) WicketSession.get() ).setSession( realmSession );
getPermissions( component, accessMgr );
}
}
}
}