|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jguard.ext.authentication.manager.AbstractAuthenticationManager
public abstract class AbstractAuthenticationManager
Abstract class which provides convenient methods for all the AuthenticationManager implementations.
| Field Summary | |
|---|---|
protected java.lang.String |
applicationName
|
protected boolean |
debug
|
protected net.sf.jguard.core.organization.Organization |
defaultOrganization
|
protected java.util.Map |
localPrincipals
|
protected java.util.Set |
localPrincipalsSet
|
protected java.util.Set |
organizations
|
protected net.sf.jguard.core.provisioning.OrganizationTemplate |
organizationTemplate
|
| Constructor Summary | |
|---|---|
AbstractAuthenticationManager(java.util.Map options)
|
|
| Method Summary | |
|---|---|
void |
addPrincipalToUser(javax.security.auth.Subject user,
java.lang.String roleName)
add a role present in the webapp to the registered user. |
void |
addPrincipalToUser(javax.security.auth.Subject user,
java.lang.String roleName,
java.lang.String applicationName)
add a role present in any webapp to the registered user. |
java.security.Principal |
clonePrincipal(java.lang.String roleName)
|
java.security.Principal |
clonePrincipal(java.lang.String roleName,
java.lang.String cloneName)
|
net.sf.jguard.core.organization.Organization |
createOrganization(net.sf.jguard.core.provisioning.OrganizationTemplate organizationCandidate)
|
net.sf.jguard.core.organization.Organization |
createOrganization(net.sf.jguard.core.provisioning.OrganizationTemplate organizationTemplate,
net.sf.jguard.core.provisioning.OrganizationTemplate organizationCandidate)
verify the organization against the provided template and create an organizationin the XML backend. |
void |
createPrincipal(java.security.Principal principal)
create a Principal in the backend, only if it is not already present. |
javax.security.auth.Subject |
createUser(javax.security.auth.Subject user,
net.sf.jguard.core.organization.Organization organization)
verify the Subject and create a user in the backend. |
javax.security.auth.Subject |
createUser(net.sf.jguard.core.provisioning.SubjectTemplate user,
net.sf.jguard.core.organization.Organization organization)
verify the Subject against the provided template and create a user in the XML backend. |
protected java.util.Set |
extractCredentials(java.util.Set credentialsIdSought,
java.util.Set credentials)
extract credentials sought |
protected java.util.Set |
extractCredentialsFromSubject(java.util.Set credentialsSought,
javax.security.auth.Subject user)
|
protected net.sf.jguard.core.authentication.credentials.JGuardCredential |
extractIdentityCredentialFromUser(javax.security.auth.Subject user)
|
javax.security.auth.Subject |
findUser(java.lang.String login)
finds a user with a private Credential with name='login' and value= parameter of this method. |
abstract java.util.Set |
findUsers(java.util.Collection privateCredentials,
java.util.Collection publicCredentials)
search the users which matches credentials criterions. |
java.lang.String |
getApplicationName()
|
java.lang.String |
getCredentialId()
|
java.lang.String |
getCredentialPassword()
|
net.sf.jguard.core.organization.Organization |
getDefaultOrganization()
|
java.security.Principal |
getLocalPrincipal(java.lang.String name)
retrieve role from the principals set of the webapp. |
java.util.Set |
getLocalPrincipals()
get the principals defined in the repository for all the applications. |
net.sf.jguard.core.provisioning.OrganizationTemplate |
getOrganizationTemplate()
|
java.security.Principal |
getRole(javax.security.auth.Subject subject,
java.lang.String roleName,
java.lang.String applicationName)
|
abstract java.util.Set |
getUsers()
|
boolean |
hasPrincipal(java.security.Principal role)
verify whether or not the role exists in the webapp. |
boolean |
hasPrincipal(java.lang.String ppalName)
verify whether or not the role exists in the webapp. |
void |
importAuthenticationManager(net.sf.jguard.core.authentication.manager.AuthenticationManager authManager)
|
protected void |
importXmlData(java.util.Map opts)
|
protected boolean |
isRole(java.security.Principal principal)
|
protected boolean |
isRoleAndLocal(java.security.Principal principal)
return true if the principal is an instance of a class or subclass of RolePrincipal and if its applicationName is equals to the name of the running application. |
boolean |
organizationAlreadyExists(net.sf.jguard.core.organization.Organization organization)
indicate wether the organization exists in the webapp or not. |
protected abstract void |
persistOrganization(net.sf.jguard.core.organization.Organization organization)
persist role in the datasource backend. |
protected abstract void |
persistPrincipal(java.security.Principal principal)
persist role in the datasource backend. |
protected abstract void |
persistUser(javax.security.auth.Subject user)
persist user in the datasource backend. |
void |
setActiveOnRolePrincipal(javax.security.auth.Subject subject,
java.lang.String roleName,
java.lang.String applicationName,
boolean active)
change 'active' property on the specified role for a user. |
abstract void |
setOrganizationTemplate(net.sf.jguard.core.provisioning.OrganizationTemplate organizationTemplate)
|
void |
updateRoleDefinition(javax.security.auth.Subject subject,
java.lang.String roleName,
java.lang.String applicationName,
java.lang.String definition)
|
void |
updateUser(net.sf.jguard.core.authentication.credentials.JGuardCredential identityCred,
javax.security.auth.Subject user)
|
protected abstract void |
updateUserImpl(net.sf.jguard.core.authentication.credentials.JGuardCredential identityCred,
javax.security.auth.Subject user)
|
boolean |
userAlreadyExists(javax.security.auth.Subject user)
indicate wether the user exists in the webapp or not. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface net.sf.jguard.core.authentication.manager.AuthenticationManager |
|---|
deleteOrganization, deletePrincipal, deleteUser, findOrganization, getAllPrincipalsSet, getOrganizations, isEmpty, persistUserLoginAttempt, persistUserLogoutAttempt, updateOrganization, updatePrincipal |
| Field Detail |
|---|
protected net.sf.jguard.core.provisioning.OrganizationTemplate organizationTemplate
protected boolean debug
protected net.sf.jguard.core.organization.Organization defaultOrganization
protected java.lang.String applicationName
protected java.util.Set localPrincipalsSet
protected java.util.Map localPrincipals
protected java.util.Set organizations
| Constructor Detail |
|---|
public AbstractAuthenticationManager(java.util.Map options)
| Method Detail |
|---|
public java.lang.String getApplicationName()
getApplicationName in interface net.sf.jguard.core.authentication.manager.AuthenticationManagerprotected void importXmlData(java.util.Map opts)
public net.sf.jguard.core.organization.Organization getDefaultOrganization()
getDefaultOrganization in interface net.sf.jguard.core.authentication.manager.AuthenticationManager
public abstract void setOrganizationTemplate(net.sf.jguard.core.provisioning.OrganizationTemplate organizationTemplate)
throws net.sf.jguard.core.authentication.AuthenticationException
setOrganizationTemplate in interface net.sf.jguard.core.authentication.manager.AuthenticationManagernet.sf.jguard.core.authentication.AuthenticationException
public javax.security.auth.Subject createUser(net.sf.jguard.core.provisioning.SubjectTemplate user,
net.sf.jguard.core.organization.Organization organization)
throws net.sf.jguard.core.provisioning.RegistrationException
createUser in interface net.sf.jguard.core.authentication.manager.AuthenticationManageruser - Subject to create in the XML backend
net.sf.jguard.core.authentication.AuthenticationException - if user already exists
net.sf.jguard.core.provisioning.RegistrationExceptionnet.sf.jguard.core.authentication.manager.AuthenticationManager#createUser(javax.security.auth.Subject)
public javax.security.auth.Subject createUser(javax.security.auth.Subject user,
net.sf.jguard.core.organization.Organization organization)
throws net.sf.jguard.core.authentication.AuthenticationException
createUser in interface net.sf.jguard.core.authentication.manager.AuthenticationManageruser - Subject to create in the backend
net.sf.jguard.core.authentication.AuthenticationExceptionnet.sf.jguard.core.authentication.manager.AuthenticationManager#createUser(javax.security.auth.Subject)
public net.sf.jguard.core.organization.Organization createOrganization(net.sf.jguard.core.provisioning.OrganizationTemplate organizationCandidate)
throws net.sf.jguard.core.provisioning.RegistrationException
createOrganization in interface net.sf.jguard.core.authentication.manager.AuthenticationManagernet.sf.jguard.core.provisioning.RegistrationException
public net.sf.jguard.core.organization.Organization createOrganization(net.sf.jguard.core.provisioning.OrganizationTemplate organizationTemplate,
net.sf.jguard.core.provisioning.OrganizationTemplate organizationCandidate)
throws net.sf.jguard.core.provisioning.RegistrationException
organizationCandidate - organizationTemplate -
net.sf.jguard.core.authentication.AuthenticationException - if user already exists
net.sf.jguard.core.provisioning.RegistrationException
public void createPrincipal(java.security.Principal principal)
throws net.sf.jguard.core.authentication.AuthenticationException
createPrincipal in interface net.sf.jguard.core.authentication.manager.AuthenticationManagerprincipal - Principal to create in the backend
net.sf.jguard.core.authentication.AuthenticationExceptionnet.sf.jguard.core.authentication.manager.AuthenticationManager#createPrincipal(javax.security.auth.Subject)
protected abstract void persistUser(javax.security.auth.Subject user)
throws net.sf.jguard.core.authentication.AuthenticationException
user -
net.sf.jguard.core.authentication.AuthenticationException
protected abstract void persistPrincipal(java.security.Principal principal)
throws net.sf.jguard.core.authentication.AuthenticationException
principal - to persist
net.sf.jguard.core.authentication.AuthenticationException
protected abstract void persistOrganization(net.sf.jguard.core.organization.Organization organization)
throws net.sf.jguard.core.authentication.AuthenticationException
principal - to persist
net.sf.jguard.core.authentication.AuthenticationExceptionpublic java.util.Set getLocalPrincipals()
getLocalPrincipals in interface net.sf.jguard.core.authentication.manager.AuthenticationManager
public java.security.Principal getLocalPrincipal(java.lang.String name)
throws net.sf.jguard.core.authentication.AuthenticationException
getLocalPrincipal in interface net.sf.jguard.core.authentication.manager.AuthenticationManagername -
net.sf.jguard.core.authentication.AuthenticationExceptionnet.sf.jguard.core.authentication.manager.AuthenticationManager#getRole(java.lang.String)
public boolean userAlreadyExists(javax.security.auth.Subject user)
throws net.sf.jguard.core.authentication.AuthenticationException
userAlreadyExists in interface net.sf.jguard.core.authentication.manager.AuthenticationManageruser - we are looking for
net.sf.jguard.core.authentication.AuthenticationExceptionAuthenticationManager.userAlreadyExists(javax.security.auth.Subject)
public boolean organizationAlreadyExists(net.sf.jguard.core.organization.Organization organization)
throws net.sf.jguard.core.authentication.AuthenticationException
organization - we are looking for
net.sf.jguard.core.authentication.AuthenticationExceptionAuthenticationManager.userAlreadyExists(javax.security.auth.Subject)
public void addPrincipalToUser(javax.security.auth.Subject user,
java.lang.String roleName)
throws net.sf.jguard.core.authentication.AuthenticationException
net.sf.jguard.core.authentication.AuthenticationExceptionnet.sf.jguard.core.authentication.manager.AuthenticationManager#addPrincipalToUser(javax.security.auth.Subject, java.lang.String)
public void addPrincipalToUser(javax.security.auth.Subject user,
java.lang.String roleName,
java.lang.String applicationName)
throws net.sf.jguard.core.authentication.AuthenticationException
net.sf.jguard.core.authentication.AuthenticationExceptionnet.sf.jguard.core.authentication.manager.AuthenticationManager#addPrincipalToUser(javax.security.auth.Subject, java.lang.String)
public boolean hasPrincipal(java.security.Principal role)
throws net.sf.jguard.core.authentication.AuthenticationException
hasPrincipal in interface net.sf.jguard.core.authentication.manager.AuthenticationManagerrole -
net.sf.jguard.core.authentication.AuthenticationException
public boolean hasPrincipal(java.lang.String ppalName)
throws net.sf.jguard.core.authentication.AuthenticationException
hasPrincipal in interface net.sf.jguard.core.authentication.manager.AuthenticationManagerppalName - Principal's name
net.sf.jguard.core.authentication.AuthenticationException
public void updateUser(net.sf.jguard.core.authentication.credentials.JGuardCredential identityCred,
javax.security.auth.Subject user)
throws net.sf.jguard.core.authentication.AuthenticationException
updateUser in interface net.sf.jguard.core.authentication.manager.AuthenticationManagernet.sf.jguard.core.authentication.AuthenticationException
protected abstract void updateUserImpl(net.sf.jguard.core.authentication.credentials.JGuardCredential identityCred,
javax.security.auth.Subject user)
throws net.sf.jguard.core.authentication.AuthenticationException
net.sf.jguard.core.authentication.AuthenticationException
public abstract java.util.Set findUsers(java.util.Collection privateCredentials,
java.util.Collection publicCredentials)
throws net.sf.jguard.core.authentication.AuthenticationException
findUsers in interface net.sf.jguard.core.authentication.manager.AuthenticationManagercredentials - crierions used to grab the users
net.sf.jguard.core.authentication.AuthenticationException
public abstract java.util.Set getUsers()
throws net.sf.jguard.core.authentication.AuthenticationException
getUsers in interface net.sf.jguard.core.authentication.manager.AuthenticationManagernet.sf.jguard.core.authentication.AuthenticationExceptionpublic void importAuthenticationManager(net.sf.jguard.core.authentication.manager.AuthenticationManager authManager)
importAuthenticationManager in interface net.sf.jguard.core.authentication.manager.AuthenticationManager
protected java.util.Set extractCredentials(java.util.Set credentialsIdSought,
java.util.Set credentials)
credentials - Ids Soughtcredentials -
protected java.util.Set extractCredentialsFromSubject(java.util.Set credentialsSought,
javax.security.auth.Subject user)
protected net.sf.jguard.core.authentication.credentials.JGuardCredential extractIdentityCredentialFromUser(javax.security.auth.Subject user)
throws net.sf.jguard.core.authentication.AuthenticationException
net.sf.jguard.core.authentication.AuthenticationException
public java.security.Principal clonePrincipal(java.lang.String roleName)
throws net.sf.jguard.core.authentication.AuthenticationException
clonePrincipal in interface net.sf.jguard.core.authentication.manager.AuthenticationManagernet.sf.jguard.core.authentication.AuthenticationExceptionAuthenticationManager.clonePrincipal(String roleName)
public java.security.Principal clonePrincipal(java.lang.String roleName,
java.lang.String cloneName)
throws net.sf.jguard.core.authentication.AuthenticationException
clonePrincipal in interface net.sf.jguard.core.authentication.manager.AuthenticationManagernet.sf.jguard.core.authentication.AuthenticationExceptionAuthenticationManager.clonePrincipal(String roleName, String cloneName)
public void setActiveOnRolePrincipal(javax.security.auth.Subject subject,
java.lang.String roleName,
java.lang.String applicationName,
boolean active)
throws net.sf.jguard.core.authentication.AuthenticationException
setActiveOnRolePrincipal in interface net.sf.jguard.core.authentication.manager.AuthenticationManagersubject - roleName - applicationName - active -
net.sf.jguard.core.authentication.AuthenticationException
public java.security.Principal getRole(javax.security.auth.Subject subject,
java.lang.String roleName,
java.lang.String applicationName)
throws net.sf.jguard.core.authentication.AuthenticationException
net.sf.jguard.core.authentication.AuthenticationExceptionpublic javax.security.auth.Subject findUser(java.lang.String login)
findUser in interface net.sf.jguard.core.authentication.manager.AuthenticationManagerlogin - am -
public void updateRoleDefinition(javax.security.auth.Subject subject,
java.lang.String roleName,
java.lang.String applicationName,
java.lang.String definition)
throws net.sf.jguard.core.authentication.AuthenticationException
updateRoleDefinition in interface net.sf.jguard.core.authentication.manager.AuthenticationManagernet.sf.jguard.core.authentication.AuthenticationExceptionpublic java.lang.String getCredentialId()
getCredentialId in interface net.sf.jguard.core.authentication.manager.AuthenticationManagerpublic net.sf.jguard.core.provisioning.OrganizationTemplate getOrganizationTemplate()
getOrganizationTemplate in interface net.sf.jguard.core.authentication.manager.AuthenticationManagerprotected boolean isRoleAndLocal(java.security.Principal principal)
principal -
protected boolean isRole(java.security.Principal principal)
public java.lang.String getCredentialPassword()
getCredentialPassword in interface net.sf.jguard.core.authentication.manager.AuthenticationManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||