new KerberosAuthenticator(), clientSslFactory); connection = aUrl.openConnection(url, token); HttpsURLConnection httpsConn = (HttpsURLConnection) connection; httpsConn.setSSLSocketFactory(sslSocketF); } else { aUrl = new AuthenticatedURL(new KerberosAuthenticator()); connection = aUrl.openConnection(url, token);
/** * Initiate client side Kerberos negotiation with the server. * @param method method to inject the authentication token into. * @param uri the String to parse as a URL. * @throws IOException if unknown protocol is found. */ private void negotiate(HttpUriRequest method, String uri) throws IOException { try { AuthenticatedURL.Token token = new AuthenticatedURL.Token(); KerberosAuthenticator authenticator = new KerberosAuthenticator(); authenticator.authenticate(new URL(uri), token); // Inject the obtained negotiated token in the method cookie injectToken(method, token); } catch (AuthenticationException e) { LOG.error("Failed to negotiate with the server.", e); throw new IOException(e); } }
if (isTokenKerberos(token)) { return; if (!needFallback && isNegotiate(conn)) { LOG.debug("Performing our own SPNEGO sequence."); doSpnegoSequence(token); } else { LOG.debug("Using fallback authenticator sequence."); Authenticator auth = getFallBackAuthenticator(); throw wrapExceptionWithMessage(ex, "Error while authenticating with endpoint: " + url); } catch (AuthenticationException ex){ throw wrapExceptionWithMessage(ex, "Error while authenticating with endpoint: " + url);
} else if (isNegotiate()) { LOG.debug("Performing our own SPNEGO sequence."); doSpnegoSequence(token); } else { LOG.debug("Using fallback authenticator sequence."); Authenticator auth = getFallBackAuthenticator();
if (isTokenKerberos(token)) { return; if (!needFallback && isNegotiate()) { LOG.debug("Performing our own SPNEGO sequence."); doSpnegoSequence(token); } else { LOG.debug("Using fallback authenticator sequence."); Authenticator auth = getFallBackAuthenticator();
/** * Initiate client side Kerberos negotiation with the server. * @param method method to inject the authentication token into. * @param uri the String to parse as a URL. * @throws IOException if unknown protocol is found. */ private void negotiate(HttpUriRequest method, String uri) throws IOException { try { AuthenticatedURL.Token token = new AuthenticatedURL.Token(); KerberosAuthenticator authenticator = new KerberosAuthenticator(); authenticator.authenticate(new URL(uri), token); // Inject the obtained negotiated token in the method cookie injectToken(method, token); } catch (AuthenticationException e) { LOG.error("Failed to negotiate with the server.", e); throw new IOException(e); } }
@Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), true); return null; } });
if (isTokenKerberos(token)) { return; if (!needFallback && isNegotiate()) { LOG.debug("Performing our own SPNEGO sequence."); doSpnegoSequence(token); } else { LOG.debug("Using fallback authenticator sequence."); Authenticator auth = getFallBackAuthenticator();
@Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), false); return null; } });
if (isTokenKerberos(token)) { return; if (!needFallback && isNegotiate()) { LOG.debug("Performing our own SPNEGO sequence."); doSpnegoSequence(token); } else { LOG.debug("Using fallback authenticator sequence."); Authenticator auth = getFallBackAuthenticator();
@Override public Void call() throws Exception { auth._testAuthenticationHttpClient(new KerberosAuthenticator(), false); return null; } });
if (isTokenKerberos(token)) { return; if (!needFallback && isNegotiate()) { LOG.debug("Performing our own SPNEGO sequence."); doSpnegoSequence(token); } else { LOG.debug("Using fallback authenticator sequence."); Authenticator auth = getFallBackAuthenticator();
@Override public Void call() throws Exception { auth._testAuthenticationHttpClient(new KerberosAuthenticator(), false); return null; } });
@Override public Void call() throws Exception { auth._testAuthenticationHttpClient(new KerberosAuthenticator(), true); return null; } });
@Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), true); return null; } });
@Override public Void call() throws Exception { auth._testAuthenticationHttpClient(new KerberosAuthenticator(), true); return null; } });
@Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), true); return null; } });
@Override public Void call() throws Exception { auth._testAuthenticationHttpClient(new KerberosAuthenticator(), true); return null; } });
@Override public Void call() throws Exception { auth._testAuthentication(new KerberosAuthenticator(), false); return null; } });
@Override public Void call() throws Exception { auth._testAuthenticationHttpClient(new KerberosAuthenticator(), true); return null; } });