List of usage examples for org.apache.zookeeper.server ServerCnxn addAuthInfo
public void addAuthInfo(Id id)
From source file:morello.zk.acl.CustomUserAuthenticationProvider.java
License:Apache License
@Override public Code handleAuthentication(ServerCnxn cnxn, byte[] authData) { final String userName = new String(authData, Charsets.UTF_8); // A non null or empty user name must be provided if (!Strings.isNullOrEmpty(userName)) { // This line is VERY important ! return code is not enough cnxn.addAuthInfo(new Id(getScheme(), userName)); return Code.OK; }/*w w w .j a va2 s .c o m*/ return Code.AUTHFAILED; }
From source file:org.trustedanalytics.auth.gateway.zookeeper.integration.testserver.BackdoorAuthProvider.java
License:Apache License
@Override public KeeperException.Code handleAuthentication(ServerCnxn serverCnxn, byte[] bytes) { serverCnxn.addAuthInfo(new Id("super", "")); return KeeperException.Code.OK; }