org.springframework.richclient.security
Class TestAuthenticationManager

Show UML class diagram
java.lang.Object
  extended by org.springframework.richclient.security.TestAuthenticationManager
All Implemented Interfaces:
org.springframework.security.AuthenticationManager

public class TestAuthenticationManager
extends Object
implements org.springframework.security.AuthenticationManager

Test implementation giving us control over the authentication results.

Author:
Larry Streepy

Field Summary
static org.springframework.security.Authentication BAD_CREDENTIALS
          Token to use to force a failed (bad credentials) authentication.
static org.springframework.security.Authentication LOCKED
          Token to use to force a LOCKED authentication exception.
static String ROLE_EXPECTED
          Test role
static org.springframework.security.Authentication VALID_USER1
          Token to use to force a successful authentication.
static org.springframework.security.Authentication VALID_USER2
          Token to use to force a successful authentication.
 
Constructor Summary
TestAuthenticationManager()
           
 
Method Summary
 org.springframework.security.Authentication authenticate(org.springframework.security.Authentication authentication)
          Authenticate a token
static org.springframework.security.Authentication makeAuthentication(String user, String password, String role)
          Construct a token with the given id, password, and role
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ROLE_EXPECTED

public static final String ROLE_EXPECTED
Test role

See Also:
Constant Field Values

VALID_USER1

public static final org.springframework.security.Authentication VALID_USER1
Token to use to force a successful authentication.


VALID_USER2

public static final org.springframework.security.Authentication VALID_USER2
Token to use to force a successful authentication.


BAD_CREDENTIALS

public static final org.springframework.security.Authentication BAD_CREDENTIALS
Token to use to force a failed (bad credentials) authentication.


LOCKED

public static final org.springframework.security.Authentication LOCKED
Token to use to force a LOCKED authentication exception.

Constructor Detail

TestAuthenticationManager

public TestAuthenticationManager()
Method Detail

makeAuthentication

public static org.springframework.security.Authentication makeAuthentication(String user,
                                                                             String password,
                                                                             String role)
Construct a token with the given id, password, and role


authenticate

public org.springframework.security.Authentication authenticate(org.springframework.security.Authentication authentication)
                                                         throws org.springframework.security.AuthenticationException
Authenticate a token

Specified by:
authenticate in interface org.springframework.security.AuthenticationManager
Throws:
org.springframework.security.AuthenticationException


Copyright © 2004-2009 The Spring Framework. All Rights Reserved.