public SystemCredentials(String instanceID, String principal, AuthenticationToken token) { super(principal, token); AS_THRIFT = super.toThrift(instanceID); }
@Override public boolean authenticateUser(final String principal, final AuthenticationToken token) throws AccumuloException, AccumuloSecurityException { checkArgument(principal != null, "principal is null"); checkArgument(token != null, "token is null"); final Credentials toAuth = new Credentials(principal, token); return execute(client -> client.authenticateUser(Tracer.traceInfo(), context.rpcCreds(), toAuth.toThrift(context.getInstanceID()))); }
/** * Serialize the credentials just before initiating the RPC call */ public synchronized TCredentials rpcCreds() { ensureOpen(); if (getCredentials().getToken().isDestroyed()) { rpcCreds = null; } if (rpcCreds == null) { rpcCreds = getCredentials().toThrift(getInstanceID()); } return rpcCreds; }