public void close() throws IOException { if (saslClient != null) saslClient.dispose(); }
public byte[] evaluateResponse(byte[] response) throws SaslException { return saslServer.evaluateResponse(response); }
public boolean isComplete() { return saslClient.isComplete(); }
private void handleAuthorizeCallback(AuthorizeCallback ac) { String authenticationID = ac.getAuthenticationID(); String authorizationID = ac.getAuthorizationID(); LOG.info("Successfully authenticated client: authenticationID={}; authorizationID={}.", authenticationID, authorizationID); ac.setAuthorized(true); ac.setAuthorizedID(authenticationID); }
private void handleRealmCallback(RealmCallback rc) { LOG.trace("Client supplied realm: {} ", rc.getDefaultText()); rc.setText(rc.getDefaultText()); }
public byte[] getInitialResponse() throws SaslException { if (saslClient.hasInitialResponse()) { return saslClient.evaluateChallenge(EMPTY_TOKEN); } else { return EMPTY_TOKEN; } }
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { AuthorizeCallback ac = null; for (Callback callback : callbacks) { if (callback instanceof AuthorizeCallback) { ac = (AuthorizeCallback) callback; } } ac.setAuthorized(false); } }
protected SaslClient createDigestSaslClient(String[] mechanismNames, String saslDefaultRealm, CallbackHandler saslClientCallbackHandler) throws IOException { return Sasl.createSaslClient(mechanismNames, null, null, saslDefaultRealm, saslProps, saslClientCallbackHandler); }
public String getUserName() { return saslServer.getAuthorizationID(); }
public boolean isComplete() { return saslServer.isComplete(); }
public String getMechanismName() { if (client != null) return client.getMechanismName(); else return server.getMechanismName(); }
@Override public void close() throws IOException { if (principalBuilder instanceof Closeable) Utils.closeQuietly((Closeable) principalBuilder, "principal builder"); if (saslServer != null) saslServer.dispose(); }
public boolean isComplete() { return saslClient.isComplete(); }
@Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { AuthorizeCallback ac = null; for (Callback callback : callbacks) { if (callback instanceof AuthorizeCallback) { ac = (AuthorizeCallback) callback; } } ac.setAuthorized(true); } }
protected SaslClient createKerberosSaslClient(String[] mechanismNames, String userFirstPart, String userSecondPart) throws IOException { return Sasl.createSaslClient(mechanismNames, null, userFirstPart, userSecondPart, saslProps, null); }
public String getAuthorizationID() { return saslServer.getAuthorizationID(); }
public boolean isComplete() { return saslServer.isComplete(); }
public KeeperState getKeeperState() { if (saslClient != null) { if (saslState == SaslState.FAILED) { return KeeperState.AuthFailed; } if (saslClient.isComplete()) { if (saslState == SaslState.INTERMEDIATE) { saslState = SaslState.COMPLETE; return KeeperState.SaslAuthenticated; } } } // No event ready to emit yet. return null; }
public String getUserName() { return saslServer.getAuthorizationID(); }
public boolean isComplete() { return saslServer.isComplete(); }