info.magnolia.jaas.sp.jcr
Class JCRAuthorizationModule

java.lang.Object
  extended by info.magnolia.jaas.sp.AbstractLoginModule
      extended by info.magnolia.jaas.sp.jcr.JCRAuthorizationModule
All Implemented Interfaces:
LoginModule

public class JCRAuthorizationModule
extends AbstractLoginModule

This is a default login module for magnolia, it uses initialized repository as defined by the provider interface.

Version:
$Id: JCRAuthorizationModule.java 50229 2011-10-20 16:10:16Z tmattsson $
Author:
Sameer Charles

Field Summary
 
Fields inherited from class info.magnolia.jaas.sp.AbstractLoginModule
callbackHandler, name, OPTION_REALM, OPTION_SKIP_ON_PREVIOUS_SUCCESS, OPTION_USE_REALM_CALLBACK, options, pswd, realm, sharedState, STATUS, STATUS_FAILED, STATUS_SKIPPED, STATUS_SUCCEDED, STATUS_SUCCEEDED, STATUS_UNAVAILABLE, subject, success, TRY_FIRST_PASS, TRY_MAPPED_PASS, USE_FIRST_PASS, USE_MAPPED_PASS, useRealmCallback
 
Constructor Summary
JCRAuthorizationModule()
           
 
Method Summary
protected  void addGroups(String[] groups)
          Sets the list of groups, info.magnolia.jaas.principal.GroupList.
protected  void addRoles(String[] roles)
          Sets the list of roles, info.magnolia.jaas.principal.RoleList.
 boolean login()
           
 void setACL()
          Sets access control list from the user, roles and groups.
protected  void setACLForGroups(String[] groups, info.magnolia.cms.security.auth.PrincipalCollection principalList)
          Looks for groups configured in magnolia repository with the given name, and configures ACLs for it.
protected  void setACLForRoles(String[] roles, info.magnolia.cms.security.auth.PrincipalCollection principalList)
          Looks for role configured in magnolia repository with the given name, and configures ACLs for it.
protected  void setACLForUser(info.magnolia.cms.security.auth.PrincipalCollection principalList, info.magnolia.cms.security.User user, info.magnolia.cms.security.SecuritySupport securitySupport)
           
 void setEntity()
          Sets user details.
 void validateUser()
          Checks if the credentials exist in the repository.
 
Methods inherited from class info.magnolia.jaas.sp.AbstractLoginModule
abort, addGroupName, addRoleName, commit, getGroupNames, getRoleNames, getSharedStatus, getSkip, initialize, logout, release, setGroupNames, setRoleNames, setSharedStatus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JCRAuthorizationModule

public JCRAuthorizationModule()
Method Detail

validateUser

public void validateUser()
                  throws LoginException
Description copied from class: AbstractLoginModule
Checks if the credentials exist in the repository.

Specified by:
validateUser in class AbstractLoginModule
Throws:
LoginException - or specific subclasses to report failures.

login

public boolean login()
              throws LoginException
Specified by:
login in interface LoginModule
Overrides:
login in class AbstractLoginModule
Throws:
LoginException

setACL

public void setACL()
Sets access control list from the user, roles and groups.

Specified by:
setACL in class AbstractLoginModule

setACLForUser

protected void setACLForUser(info.magnolia.cms.security.auth.PrincipalCollection principalList,
                             info.magnolia.cms.security.User user,
                             info.magnolia.cms.security.SecuritySupport securitySupport)

setEntity

public void setEntity()
Description copied from class: AbstractLoginModule
Sets user details.

Specified by:
setEntity in class AbstractLoginModule

addGroups

protected void addGroups(String[] groups)
Sets the list of groups, info.magnolia.jaas.principal.GroupList.

Parameters:
groups - array of group names

addRoles

protected void addRoles(String[] roles)
Sets the list of roles, info.magnolia.jaas.principal.RoleList.

Parameters:
roles - array of role names

setACLForRoles

protected void setACLForRoles(String[] roles,
                              info.magnolia.cms.security.auth.PrincipalCollection principalList)
Looks for role configured in magnolia repository with the given name, and configures ACLs for it.

Parameters:
roles - array of role names.
principalList - PrincipalCollection

setACLForGroups

protected void setACLForGroups(String[] groups,
                               info.magnolia.cms.security.auth.PrincipalCollection principalList)
Looks for groups configured in magnolia repository with the given name, and configures ACLs for it.

Parameters:
groups - array of group names.
principalList - PrincipalCollection


Copyright © 2003-2011 Magnolia International Ltd.. All Rights Reserved.