forked from jooby-project/jooby
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAuthPlugin.java
More file actions
35 lines (27 loc) · 760 Bytes
/
AuthPlugin.java
File metadata and controls
35 lines (27 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package app;
import org.crsh.auth.AuthenticationPlugin;
import org.crsh.plugin.CRaSHPlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class AuthPlugin extends CRaSHPlugin<AuthPlugin>
implements AuthenticationPlugin<String> {
/** The logging system. */
private final Logger log = LoggerFactory.getLogger(getClass());
@Override
public AuthPlugin getImplementation() {
return this;
}
@Override
public String getName() {
return "auth";
}
@Override
public Class<String> getCredentialType() {
return String.class;
}
@Override
public boolean authenticate(final String username, final String credential) throws Exception {
log.info("{} pass {}", username, credential);
return true;
}
}