PageRenderTime 17ms CodeModel.GetById 14ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1/*
 2 * To change this template, choose Tools | Templates
 3 * and open the template in the editor.
 4 */
 5
 6package name.aikesommer.authenticator.test;
 7
 8import name.aikesommer.authenticator.AuthenticationRequest;
 9import name.aikesommer.authenticator.FormAuthenticator;
10import name.aikesommer.authenticator.PluggableAuthenticator.AuthenticationManager;
11import name.aikesommer.authenticator.SimplePrincipal;
12
13/**
14 *
15 * @author Aike J Sommer
16 */
17public class TestAuthenticator extends FormAuthenticator {
18
19    @Override
20    protected boolean checkCredentials(AuthenticationManager manager, AuthenticationRequest request, String username, String password) {
21        return "test".equals(username) && "test".equals(password);
22    }
23
24    @Override
25    protected SimplePrincipal loadPrincipal(AuthenticationManager manager, AuthenticationRequest request, String username) {
26        return new SimplePrincipal(username, "user");
27    }
28
29}