to activate/passivate a role owned by a user, we need to:

  • grab the current AuthenticationManager
AuthenticationManager authenticationManager =(AuthenticationManager)request.getSession().getServletContext().getAttribute(SecurityConstants.AUTHENTICATION_MANAGER);

  • grab the User (i.e the Subject)
HttpAuthenticationUtils auth= (HttpAuthenticationUtils)request.getSession(true).getAttribute(HttpConstants.AUTHN_UTILS);
Subject user = auth.getSubject();

  • define the active flag on the role
authenticationManager.setActiveOnRolePrincipal(user,roleName,applicationName,active);
Version 1.4 last modified by Charles Gay on 02/01/2007 at 13:29

Comments 0

No comments for this document

Attachments 0

No attachments for this document
 

Creator: Charles Gay on 2007/01/02 13:25
jGuard team copyright 2004-2007
1.1.1