Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.acegisecurity.runas
Class RunAsImplAuthenticationProvider  view RunAsImplAuthenticationProvider download RunAsImplAuthenticationProvider.java

java.lang.Object
  extended byorg.acegisecurity.runas.RunAsImplAuthenticationProvider
All Implemented Interfaces:
org.acegisecurity.providers.AuthenticationProvider, org.springframework.beans.factory.InitializingBean, org.springframework.context.MessageSourceAware

public class RunAsImplAuthenticationProvider
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, org.acegisecurity.providers.AuthenticationProvider, org.springframework.context.MessageSourceAware

An org.acegisecurity.providers.AuthenticationProvider implementation that can authenticate a RunAsUserToken.

Configured in the bean context with a key that should match the key used by adapters to generate the RunAsUserToken. It treats as valid any RunAsUserToken instance presenting a hash code that matches the RunAsImplAuthenticationProvider-configured key.

If the key does not match, a BadCredentialsException is thrown.


Field Summary
private  java.lang.String key
           
protected  org.springframework.context.support.MessageSourceAccessor messages
           
 
Constructor Summary
RunAsImplAuthenticationProvider()
           
 
Method Summary
 void afterPropertiesSet()
          Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
 org.acegisecurity.Authentication authenticate(org.acegisecurity.Authentication authentication)
          Performs authentication with the same contract as AuthenticationManager.authenticate(Authentication)>AuthenticationManager.authenticate(Authentication) 55 .
 java.lang.String getKey()
           
 void setKey(java.lang.String key)
           
 void setMessageSource(org.springframework.context.MessageSource messageSource)
          Set the MessageSource that this object runs in.
 boolean supports(java.lang.Class authentication)
          Returns true if this AuthenticationProvider supports the indicated Authentication object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

messages

protected org.springframework.context.support.MessageSourceAccessor messages

key

private java.lang.String key
Constructor Detail

RunAsImplAuthenticationProvider

public RunAsImplAuthenticationProvider()
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:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean

authenticate

public org.acegisecurity.Authentication authenticate(org.acegisecurity.Authentication authentication)
                                              throws org.acegisecurity.AuthenticationException
Description copied from interface: org.acegisecurity.providers.AuthenticationProvider
Performs authentication with the same contract as AuthenticationManager.authenticate(Authentication)>AuthenticationManager.authenticate(Authentication) 55 .

Specified by:
authenticate in interface org.acegisecurity.providers.AuthenticationProvider

getKey

public java.lang.String getKey()

setKey

public void setKey(java.lang.String key)

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:
setMessageSource in interface org.springframework.context.MessageSourceAware

supports

public boolean supports(java.lang.Class authentication)
Description copied from interface: org.acegisecurity.providers.AuthenticationProvider
Returns true if this AuthenticationProvider supports the indicated Authentication object.

Returning true does not guarantee an AuthenticationProvider will be able to authenticate the presented instance of the Authentication class. It simply indicates it can support closer evaluation of it. An AuthenticationProvider can still return null from the AuthenticationProvider.authenticate(Authentication)>AuthenticationProvider.authenticate(Authentication) 55 method to indicate another AuthenticationProvider should be tried.

Selection of an AuthenticationProvider capable of performing authentication is conducted at runtime the ProviderManager.

Specified by:
supports in interface org.acegisecurity.providers.AuthenticationProvider