< prev index next >
src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AuthenticationFilter.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -52,10 +52,13 @@
"jdk.httpclient.auth.retrylimit", DEFAULT_RETRY_LIMIT);
static final int UNAUTHORIZED = 401;
static final int PROXY_UNAUTHORIZED = 407;
+ // A public no-arg constructor is required by FilterFactory
+ public AuthenticationFilter() {}
+
private PasswordAuthentication getCredentials(String header,
boolean proxy,
HttpRequestImpl req)
throws IOException
{
@@ -81,11 +84,11 @@
rtype
);
}
private URI getProxyURI(HttpRequestImpl r) {
- InetSocketAddress proxy = r.proxy(exchange.client());
+ InetSocketAddress proxy = r.proxy();
if (proxy == null) {
return null;
}
// our own private scheme for proxy URLs
@@ -214,11 +217,10 @@
if (!scheme.equalsIgnoreCase("Basic")) {
return null; // error gets returned to app
}
- String realm = parser.findValue("realm");
AuthInfo au = proxy ? exchange.proxyauth : exchange.serverauth;
if (au == null) {
PasswordAuthentication pw = getCredentials(authval, proxy, req);
if (pw == null) {
throw new IOException("No credentials provided");
< prev index next >