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
12
13
14
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 }