|
|||||||||
| Home >> All >> org >> acegisecurity >> [ providers overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.acegisecurity.providers
Class ProviderManager

java.lang.Objectorg.acegisecurity.AbstractAuthenticationManager
org.acegisecurity.providers.ProviderManager
- All Implemented Interfaces:
- org.springframework.context.ApplicationEventPublisherAware, org.acegisecurity.AuthenticationManager, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware
- public class ProviderManager
- extends org.acegisecurity.AbstractAuthenticationManager
- implements org.springframework.beans.factory.InitializingBean, org.springframework.context.ApplicationEventPublisherAware, org.springframework.context.MessageSourceAware
- extends org.acegisecurity.AbstractAuthenticationManager
Iterates an org.acegisecurity.Authentication request through a list of AuthenticationProviders. Can optionally be configured with a ConcurrentSessionController to limit the number of sessions a user can
have.
AuthenticationProviders are tried in order until one provides a
non-null response. A non-null response indicates the provider had authority
to decide on the authentication request and no further providers are tried.
If an AuthenticationException is thrown by a provider, it is
retained until subsequent providers are tried. If a subsequent provider
successfully authenticates the request, the earlier authentication
exception is disregarded and the successful authentication will be used. If
no subsequent provider provides a non-null response, or a new
AuthenticationException, the last
AuthenticationException received will be used. If no provider
returns a non-null response, or indicates it can even process an
Authentication, the ProviderManager will throw a
ProviderNotFoundException.
If a valid Authentication is returned by an
AuthenticationProvider, the ProviderManager will
publish an org.acegisecurity.event.authentication.AuthenticationSuccessEvent. If an
AuthenticationException is detected, the final
AuthenticationException thrown will be used to publish an
appropriate failure event. By default ProviderManager maps
common exceptions to events, but this can be fine-tuned by providing a new
exceptionMappingsjava.util.Properties object. In
the properties object, each of the keys represent the fully qualified
classname of the exception, and each of the values represent the name of an
event class which subclasses org.acegisecurity.event.authentication.AbstractAuthenticationFailureEvent
and provides its constructor.
| Field Summary | |
private org.springframework.context.ApplicationEventPublisher |
applicationEventPublisher
|
private java.util.Properties |
exceptionMappings
|
private static org.apache.commons.logging.Log |
logger
|
protected org.springframework.context.support.MessageSourceAccessor |
messages
|
private java.util.List |
providers
|
private ConcurrentSessionController |
sessionController
|
| Constructor Summary | |
ProviderManager()
|
|
| Method Summary | |
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware). |
private void |
checkIfValidList(java.util.List listToCheck)
|
protected void |
doAddExtraDefaultExceptionMappings(java.util.Properties exceptionMappings)
Provided so subclasses can add extra exception mappings during startup if no exception mappings are injected by the IoC container. |
org.acegisecurity.Authentication |
doAuthentication(org.acegisecurity.Authentication authentication)
Attempts to authenticate the passed org.acegisecurity.Authentication object. |
java.util.List |
getProviders()
|
ConcurrentSessionController |
getSessionController()
The configured ConcurrentSessionController is returned or the
NullConcurrentSessionController if a specific one has not been
set. |
void |
setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
Set the ApplicationEventPublisher that this object runs in. |
void |
setMessageSource(org.springframework.context.MessageSource messageSource)
Set the MessageSource that this object runs in. |
void |
setProviders(java.util.List newList)
Sets the AuthenticationProvider objects to be used for authentication. |
void |
setSessionController(ConcurrentSessionController sessionController)
Set the ConcurrentSessionController to be used for limiting
user's sessions. |
| Methods inherited from class org.acegisecurity.AbstractAuthenticationManager |
authenticate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
logger
private static final org.apache.commons.logging.Log logger
applicationEventPublisher
private org.springframework.context.ApplicationEventPublisher applicationEventPublisher
sessionController
private ConcurrentSessionController sessionController
providers
private java.util.List providers
messages
protected org.springframework.context.support.MessageSourceAccessor messages
exceptionMappings
private java.util.Properties exceptionMappings
| Constructor Detail |
ProviderManager
public ProviderManager()
| Method Detail |
afterPropertiesSet
public void afterPropertiesSet()
throws java.lang.Exception
- Description copied from interface:
org.springframework.beans.factory.InitializingBean - Invoked by a BeanFactory after it has set all bean properties supplied
(and satisfied BeanFactoryAware and ApplicationContextAware).
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
checkIfValidList
private void checkIfValidList(java.util.List listToCheck)
doAddExtraDefaultExceptionMappings
protected void doAddExtraDefaultExceptionMappings(java.util.Properties exceptionMappings)
- Provided so subclasses can add extra exception mappings during startup
if no exception mappings are injected by the IoC container.
doAuthentication
public org.acegisecurity.Authentication doAuthentication(org.acegisecurity.Authentication authentication) throws org.acegisecurity.AuthenticationException
- Attempts to authenticate the passed org.acegisecurity.Authentication object.
The list of AuthenticationProviders will be successively tried until an
AuthenticationProviderindicates it is capable of authenticating the type ofAuthenticationobject passed. Authentication will then be attempted with thatAuthenticationProvider.If more than one
AuthenticationProvidersupports the passedAuthenticationobject, only the firstAuthenticationProvidertried will determine the result. No subsequentAuthenticationProviders will be tried.
getProviders
public java.util.List getProviders()
getSessionController
public ConcurrentSessionController getSessionController()
- The configured
ConcurrentSessionControlleris returned or theNullConcurrentSessionControllerif a specific one has not been set.
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher applicationEventPublisher)
- Description copied from interface:
org.springframework.context.ApplicationEventPublisherAware - Set the ApplicationEventPublisher that this object runs in.
Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.
- Specified by:
setApplicationEventPublisherin interfaceorg.springframework.context.ApplicationEventPublisherAware
setMessageSource
public void setMessageSource(org.springframework.context.MessageSource messageSource)
- Description copied from interface:
org.springframework.context.MessageSourceAware - Set the MessageSource that this object runs in.
Invoked after population of normal bean properties but before an init callback like InitializingBean's afterPropertiesSet or a custom init-method. Invoked before ApplicationContextAware's setApplicationContext.
- Specified by:
setMessageSourcein interfaceorg.springframework.context.MessageSourceAware
setProviders
public void setProviders(java.util.List newList)
- Sets the AuthenticationProvider objects to be used for
authentication.
setSessionController
public void setSessionController(ConcurrentSessionController sessionController)
- Set the
ConcurrentSessionControllerto be used for limiting user's sessions. TheNullConcurrentSessionControlleris used by default
|
|||||||||
| Home >> All >> org >> acegisecurity >> [ providers overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC