ch.elca.el4j.services.security.authentication
Class DefaultAuthenticationService

java.lang.Object
  extended by ch.elca.el4j.services.security.authentication.DefaultAuthenticationService
All Implemented Interfaces:
AuthenticationService, InitializingBean

public class DefaultAuthenticationService
extends Object
implements AuthenticationService, InitializingBean

Default implementation of AuthenticationService used for logging in and out.

Simple usage example with a given BeanFactory:

AuthenticationService as = (AuthenticationService) beanFactory.getBean("authenticationService");
as.login(loginContext, callbackHandler);

Both parameters are optional, if they are included in the applicationContext configuration. The bean may contain two properties :


Author:
Raphael Boog (RBO), Andreas Pfenninger (APR), Christoph Schwitter (CSC)
File-location:
DefaultAuthenticationService
Last check-in date:
2010-01-15 12:21:07 +0100 (Fr, 15. Jan 2010) by jonasha for revision 4091

Constructor Summary
DefaultAuthenticationService()
           
 
Method Summary
 void afterPropertiesSet()
          
 void authenticate(org.springframework.security.core.Authentication auth)
          Authenticate using the given Authentication object.
 org.springframework.security.core.Authentication getAuthenticationData()
          Return the authentication data that is stored for this thread.
 String getUserName()
          After the user has logged in, the user's name can be accessed using this method.
 void setAuthenticationManager(org.springframework.security.authentication.AuthenticationManager am)
          Sets the authenticationManager to be used for the authentication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultAuthenticationService

public DefaultAuthenticationService()
Method Detail

getAuthenticationData

public org.springframework.security.core.Authentication getAuthenticationData()
Return the authentication data that is stored for this thread. Used by the AuthenticationServiceContextPasser.

Specified by:
getAuthenticationData in interface AuthenticationService
Returns:
The authentication data, may be null.

setAuthenticationManager

public void setAuthenticationManager(org.springframework.security.authentication.AuthenticationManager am)
Sets the authenticationManager to be used for the authentication.

Parameters:
am - The AuthenticationManager to be used for the authentication.

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception

Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

authenticate

public void authenticate(org.springframework.security.core.Authentication auth)
Authenticate using the given Authentication object.

Specified by:
authenticate in interface AuthenticationService
Parameters:
auth - The Authentication object.

getUserName

public String getUserName()
After the user has logged in, the user's name can be accessed using this method.

Specified by:
getUserName in interface AuthenticationService
Returns:
The name of the logged in user.


Copyright © 2005-2011 ELCA. All Rights Reserved.