@Override public void doAuthenticate(Credentials credentials, Session session) throws AuthenticationException { if (credentials instanceof UsernamePasswordCredentials) { String username = credentials.getUserPrincipal().getName(); String password = credentials.getPassword(); User user = userManager.check(username, password); if (user == null) { authenticationFailed(session); } authenticationSuccess(session, user); } else { throw new AuthenticationException("Only support Username/Password Authentication"); } }
@Override public void doAuthenticate(Credentials credentials, Session session) throws AuthenticationException { if (credentials instanceof UsernamePasswordCredentials) { String username = credentials.getUserPrincipal().getName(); String password = credentials.getPassword(); User user = userManager.check(username, password); if (user == null) { authenticationFailed(session); } authenticationSuccess(session, user); } else { throw new AuthenticationException("Only support Username/Password Authentication"); } }