/Testing/RoastTestApp/src/main/java/name/aikesommer/authenticator/test/TestAuthenticator.java
http://authenticroast.googlecode.com/ · Java · 29 lines · 15 code · 6 blank · 8 comment · 1 complexity · 160920354b57b7f53ae85b9de1072793 MD5 · raw file
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package name.aikesommer.authenticator.test;
- import name.aikesommer.authenticator.AuthenticationRequest;
- import name.aikesommer.authenticator.FormAuthenticator;
- import name.aikesommer.authenticator.PluggableAuthenticator.AuthenticationManager;
- import name.aikesommer.authenticator.SimplePrincipal;
- /**
- *
- * @author Aike J Sommer
- */
- public class TestAuthenticator extends FormAuthenticator {
- @Override
- protected boolean checkCredentials(AuthenticationManager manager, AuthenticationRequest request, String username, String password) {
- return "test".equals(username) && "test".equals(password);
- }
- @Override
- protected SimplePrincipal loadPrincipal(AuthenticationManager manager, AuthenticationRequest request, String username) {
- return new SimplePrincipal(username, "user");
- }
- }