|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.jguard.authentication.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 static java.lang.String |
DEFAULT
|
protected java.util.Map |
localPrincipals
|
protected java.util.Set |
localPrincipalsSet
|
protected SubjectTemplate |
subjectTemplate
|
| Constructor Summary | |
|---|---|
AbstractAuthenticationManager()
|
|
| Method Summary | |
|---|---|
void |
addPrincipalToUser(javax.security.auth.Subject user,
java.lang.String roleName)
add a role present in the webapp to the registered user. |
java.security.Principal |
clonePrincipal(java.lang.String roleName)
Clone a Principal with a random name |
java.security.Principal |
clonePrincipal(java.lang.String roleName,
java.lang.String cloneName)
Clone a Principal. |
void |
createPrincipal(java.security.Principal principal)
verify the Subject and create a user in the backend. |
void |
createUser(javax.security.auth.Subject user)
verify the Subject and create a user in the XML backend. |
javax.security.auth.Subject |
createUser(SubjectTemplate user)
verify the Subject and create a user in the XML backend. |
javax.security.auth.Subject |
createUser(SubjectTemplate user,
SubjectTemplate template)
verify the Subject against the provided template and create a user in the XML backend. |
protected java.util.Set |
extractCredentials(java.util.Set credentialsSought,
java.util.Set credentials)
extract credentials sought |
protected java.util.Set |
extractCredentialsFromSubject(java.util.Set credentialsSought,
javax.security.auth.Subject user)
|
protected JGuardCredential |
extractIdentityCredentialFromUser(javax.security.auth.Subject user)
|
abstract java.util.Set |
findUsers(java.util.Collection credentials)
search the users which matches credentials criterions. |
SubjectTemplate |
getDefaultSubjectTemplate()
return the default unmodifiable SubjectTemplate. |
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. |
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(AuthenticationManager authManager)
|
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. |
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.authentication.AuthenticationManager |
|---|
deletePrincipal, deleteUser, getAllPrincipalsSet, getSubjectTemplate, init, isEmpty, persistSubjectTemplate, updatePrincipal, updateUser |
| Field Detail |
|---|
protected static final java.lang.String DEFAULT
protected SubjectTemplate subjectTemplate
protected boolean debug
protected java.lang.String applicationName
protected java.util.Set localPrincipalsSet
protected java.util.Map localPrincipals
| Constructor Detail |
|---|
public AbstractAuthenticationManager()
| Method Detail |
|---|
public javax.security.auth.Subject createUser(SubjectTemplate user)
throws AuthenticationException
createUser in interface AuthenticationManageruser - Subject to create in the XML backend
AuthenticationExceptionAuthenticationManager.createUser(javax.security.auth.Subject)
public javax.security.auth.Subject createUser(SubjectTemplate user,
SubjectTemplate template)
throws AuthenticationException
createUser in interface AuthenticationManageruser - Subject to create in the XML backendtemplate - we register user against this specific template
AuthenticationException - if user already existsAuthenticationManager.createUser(javax.security.auth.Subject)
public void createUser(javax.security.auth.Subject user)
throws AuthenticationException
createUser in interface AuthenticationManageruser - Subject to create in the XML backend
AuthenticationExceptionAuthenticationManager.createUser(javax.security.auth.Subject)
public void createPrincipal(java.security.Principal principal)
throws AuthenticationException
createPrincipal in interface AuthenticationManageruser - Subject to create in the XML backend
AuthenticationExceptionnet.sf.jguard.authentication.AuthenticationManager#createPrincipal(javax.security.auth.Subject)
protected abstract void persistUser(javax.security.auth.Subject user)
throws AuthenticationException
user -
AuthenticationException
protected abstract void persistPrincipal(java.security.Principal principal)
throws AuthenticationException
principal - to persist
AuthenticationExceptionpublic java.util.Set getLocalPrincipals()
getLocalPrincipals in interface AuthenticationManager
public java.security.Principal getLocalPrincipal(java.lang.String name)
throws AuthenticationException
getLocalPrincipal in interface AuthenticationManagername -
AuthenticationExceptionnet.sf.jguard.authentication.AuthenticationManager#getRole(java.lang.String)
public boolean userAlreadyExists(javax.security.auth.Subject user)
throws AuthenticationException
userAlreadyExists in interface AuthenticationManageruser - we are looking for
AuthenticationExceptionAuthenticationManager.userAlreadyExists(javax.security.auth.Subject)
public void addPrincipalToUser(javax.security.auth.Subject user,
java.lang.String roleName)
throws AuthenticationException
addPrincipalToUser in interface AuthenticationManagerAuthenticationExceptionAuthenticationManager.addPrincipalToUser(javax.security.auth.Subject, java.lang.String)
public boolean hasPrincipal(java.security.Principal role)
throws AuthenticationException
hasPrincipal in interface AuthenticationManagerrole -
AuthenticationException
public boolean hasPrincipal(java.lang.String ppalName)
throws AuthenticationException
hasPrincipal in interface AuthenticationManagerppalName - Principal's name
AuthenticationException
public abstract java.util.Set findUsers(java.util.Collection credentials)
throws AuthenticationException
findUsers in interface AuthenticationManagercredentials - crierions used to grab the users
AuthenticationException
public SubjectTemplate getDefaultSubjectTemplate()
throws AuthenticationException
getDefaultSubjectTemplate in interface AuthenticationManagerAuthenticationException
public abstract java.util.Set getUsers()
throws AuthenticationException
getUsers in interface AuthenticationManagerAuthenticationExceptionpublic void importAuthenticationManager(AuthenticationManager authManager)
protected java.util.Set extractCredentials(java.util.Set credentialsSought,
java.util.Set credentials)
credentialsSought - credentials -
protected java.util.Set extractCredentialsFromSubject(java.util.Set credentialsSought,
javax.security.auth.Subject user)
protected JGuardCredential extractIdentityCredentialFromUser(javax.security.auth.Subject user)
throws AuthenticationException
AuthenticationException
public java.security.Principal clonePrincipal(java.lang.String roleName)
throws AuthenticationException
AuthenticationManager
clonePrincipal in interface AuthenticationManagerroleName - Principal name to clone
AuthenticationExceptionAuthenticationManager.clonePrincipal(String roleName)
public java.security.Principal clonePrincipal(java.lang.String roleName,
java.lang.String cloneName)
throws AuthenticationException
AuthenticationManager
clonePrincipal in interface AuthenticationManagerroleName - Principal name to clonecloneName - Principal cloned name
AuthenticationExceptionAuthenticationManager.clonePrincipal(String roleName, String cloneName)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||