/** * Builds client instance with the given credentials. * Such credentials will be used only to obtain a valid JWT in the * {@link javax.ws.rs.core.HttpHeaders#AUTHORIZATION} header; * * @param username username * @param password password * @return client instance with the given credentials */ public SyncopeClient create(final String username, final String password) { return create(new BasicAuthenticationHandler(username, password)); }
restClientFactory.setPassword(((AnonymousAuthenticationHandler) handler).getPassword()); } else if (handler instanceof BasicAuthenticationHandler) { restClientFactory.setUsername(((BasicAuthenticationHandler) handler).getUsername()); restClientFactory.setPassword(((BasicAuthenticationHandler) handler).getPassword());
restClientFactory.setPassword(((AnonymousAuthenticationHandler) handler).getPassword()); } else if (handler instanceof BasicAuthenticationHandler) { restClientFactory.setUsername(((BasicAuthenticationHandler) handler).getUsername()); restClientFactory.setPassword(((BasicAuthenticationHandler) handler).getPassword());
/** * Builds client instance with the given credentials. * Such credentials will be used only to obtain a valid JWT in the * {@link javax.ws.rs.core.HttpHeaders#AUTHORIZATION} header; * * @param username username * @param password password * @return client instance with the given credentials */ public SyncopeClient create(final String username, final String password) { return create(new BasicAuthenticationHandler(username, password)); }