@Override public Boolean call() throws Exception { return authClient.getAccessToken() != null; } }, "Unable to connect to Authentication service to obtain access token, Connection info : "
protected AccessToken fetchAccessToken(String username, String password) throws IOException, TimeoutException, InterruptedException { Properties properties = new Properties(); properties.setProperty("security.auth.client.username", username); properties.setProperty("security.auth.client.password", password); properties.setProperty("security.auth.client.verify.ssl.cert", Boolean.toString(getClientConfig().isVerifySSLCert())); final AuthenticationClient authClient = new BasicAuthenticationClient(); authClient.configure(properties); ConnectionConfig connectionConfig = getClientConfig().getConnectionConfig(); authClient.setConnectionInfo(connectionConfig.getHostname(), connectionConfig.getPort(), connectionConfig.isSSLEnabled()); checkServicesWithRetry(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return authClient.getAccessToken() != null; } }, "Unable to connect to Authentication service to obtain access token, Connection info : " + connectionConfig); return authClient.getAccessToken(); }
AccessToken accessToken = authenticationClient.getAccessToken(); UserAccessToken userToken = new UserAccessToken(accessToken, username); if (accessToken != null) {
AccessToken accessToken = authenticationClient.getAccessToken(); UserAccessToken userToken = new UserAccessToken(accessToken, username); if (accessToken != null) {