View Javadoc

1   package ch.elca.el4j.tests.services.security.provider;
2   
3   import org.springframework.security.core.Authentication;
4   import org.springframework.security.core.AuthenticationException;
5   import org.springframework.security.authentication.AuthenticationProvider;
6   
7   import ch.elca.el4j.tests.services.security.TestingAuthenticationToken;
8   
9   /**
10   * 
11   * This class is an implementation of the AthenticationProvider for testing purposes.
12   * @svnLink $Revision: 4091 $;$Date: 2010-01-15 12:21:07 +0100 (Fr, 15. Jan 2010) $;$Author: jonasha $;$URL: https://el4j.svn.sourceforge.net/svnroot/el4j/branches/el4j_3_1/el4j/framework/modules/security/src/test/java/ch/elca/el4j/tests/services/security/provider/TestingAuthenticationProvider.java $
13   *
14   * @author Daniel Thomas (DTH)
15   */
16  
17  public class TestingAuthenticationProvider implements AuthenticationProvider {
18  	
19  	
20  	public Authentication authenticate(Authentication authentication) throws AuthenticationException {
21  		return authentication;
22  	}
23  
24  	public boolean supports(Class authentication) {
25  		if (TestingAuthenticationToken.class.isAssignableFrom(authentication)) {
26  			return true;
27  		} else {
28  			return false;
29  		}
30  	}
31  }