| | |
| | | @Override |
| | | public boolean authenticate(String username, final PublicKey suppliedKey, |
| | | final ServerSession session) { |
| | | final SshSession client = session.getAttribute(SshSession.KEY); |
| | | final SshDaemonClient client = session.getAttribute(SshDaemonClient.KEY); |
| | | |
| | | if (client.getRemoteUser() != null) { |
| | | if (client.getUser() != null) { |
| | | // TODO why do we re-authenticate? |
| | | log.info("{} has already authenticated!", username); |
| | | return true; |
| | |
| | | if (key.equals(suppliedKey)) { |
| | | UserModel user = authManager.authenticate(username, key); |
| | | if (user != null) { |
| | | client.authenticationSuccess(username); |
| | | client.setUser(user); |
| | | return true; |
| | | } |
| | | } |