disableCookies = (disableCookies != null) ? disableCookies : false; final AuthenticationStore auth = client.getAuthenticationStore(); final Object basicAuthProvider = config.getProperty(JettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION); if (basicAuthProvider != null && (basicAuthProvider instanceof BasicAuthentication)) {
@Override public void onSuccess(Response response) { client.getAuthenticationStore().addAuthenticationResult(authenticationResult); } }
@Override public void onSuccess(Response response) { client.getAuthenticationStore().addAuthenticationResult(authnResult); } }).send(null);
@Override public void onSuccess(Response response) { client.getAuthenticationStore().addAuthenticationResult(authnResult); } }).send(null);
@Override public IRequest setBasicAuthentication(String username, String password, String realm, boolean preemptive) { if (preemptive) { request.getHeaders().add("Authorization", "Basic " + Base64.getEncoder(). encodeToString((username + ":" + password).getBytes())); } else { AuthenticationStore auth = httpClient.getAuthenticationStore(); auth.addAuthentication(new BasicAuthentication(uri, realm, username, password)); } return this; }
protected void addBasicAuthentication(HttpClient httpClient, String url, String username) { String password = runtimeProperties.get(ClientConstants.ROP_SERVICE_PASSWORD_PROPERTY); String realm = runtimeProperties.get(ClientConstants.ROP_SERVICE_REALM_PROPERTY); if (username != null && password != null) { if (realm == null && logger.isWarnEnabled()) { logger.warn("In order to use JettyClient with BASIC Authentication " + "you should provide Constants.ROP_SERVICE_REALM_PROPERTY."); return; } if (logger.isInfoEnabled()) { logger.info( "Adding authentication" + "\nUser: " + username + "\nRealm: " + realm); } AuthenticationStore auth = httpClient.getAuthenticationStore(); auth.addAuthentication(new BasicAuthentication(URI.create(url), realm, username, password)); } }
private void applyAuthentication(Request request, URI uri) { if (uri != null) { Authentication.Result result = getHttpClient().getAuthenticationStore().findAuthenticationResult(uri); if (result != null) result.apply(request); } }
AuthenticationStore authStore = httpClient.getAuthenticationStore(); ProxyConfiguration proxyConfig = httpClient.getProxyConfiguration(); List<Proxy> proxies = proxyConfig.getProxies();
disableCookies = (disableCookies != null) ? disableCookies : false; final AuthenticationStore auth = client.getAuthenticationStore(); final Object basicAuthProvider = config.getProperty(JettyClientProperties.PREEMPTIVE_BASIC_AUTHENTICATION); if (basicAuthProvider != null && (basicAuthProvider instanceof BasicAuthentication)) {
AuthenticationStore authStore = CLIENT.getAuthenticationStore(); ProxyConfiguration proxyConfig = CLIENT.getProxyConfiguration(); List<Proxy> proxies = proxyConfig.getProxies();
httpClient.getAuthenticationStore().addAuthenticationResult(new BasicAuthentication.BasicResult(uri, user.get(), password.or("")));
Authentication.Result authnResult = client.getAuthenticationStore().findAuthenticationResult(request.getURI()); if (authnResult != null) authnResult.apply(request);
Authentication.Result authnResult = client.getAuthenticationStore().findAuthenticationResult(request.getURI()); if (authnResult != null) authnResult.apply(request);
for (WWWAuthenticate wwwAuthn : wwwAuthenticates) authentication = client.getAuthenticationStore().findAuthentication(wwwAuthn.type, uri, wwwAuthn.realm); if (authentication != null)
for (WWWAuthenticate wwwAuthn : wwwAuthenticates) authentication = client.getAuthenticationStore().findAuthentication(wwwAuthn.type, uri, wwwAuthn.realm); if (authentication != null)
authentication = client.getAuthenticationStore().findAuthentication(element.getType(), authURI, element.getRealm()); if (authentication != null)