public class KerberosAuthenticator extends Object implements Authenticator
KerberosAuthenticator implements the Kerberos SPNEGO authentication sequence.
 It uses the default principal for the Kerberos cache (normally set via kinit).
 It falls back to the PseudoAuthenticator if the HTTP endpoint does not trigger an SPNEGO authentication
 sequence.
| Modifier and Type | Field and Description | 
|---|---|
| static String | AUTHORIZATIONHTTP header used by the SPNEGO client endpoint during an authentication sequence. | 
| static String | NEGOTIATEHTTP header prefix used by the SPNEGO client/server endpoints during an authentication sequence. | 
| static String | WWW_AUTHENTICATEHTTP header used by the SPNEGO server endpoint during an authentication sequence. | 
| Constructor and Description | 
|---|
| KerberosAuthenticator() | 
| Modifier and Type | Method and Description | 
|---|---|
| void | authenticate(URL url,
            AuthenticatedURL.Token token)Performs SPNEGO authentication against the specified URL. | 
| protected Authenticator | getFallBackAuthenticator()If the specified URL does not support SPNEGO authentication, a fallback  Authenticatorwill be used. | 
| void | setConnectionConfigurator(ConnectionConfigurator configurator)Sets a  ConnectionConfiguratorinstance to use for
 configuring connections. | 
public static final String WWW_AUTHENTICATE
public static final String AUTHORIZATION
public static final String NEGOTIATE
public void setConnectionConfigurator(ConnectionConfigurator configurator)
ConnectionConfigurator instance to use for
 configuring connections.setConnectionConfigurator in interface Authenticatorconfigurator - the ConnectionConfigurator instance.public void authenticate(URL url, AuthenticatedURL.Token token) throws IOException, AuthenticationException
If a token is given it does a NOP and returns the given token.
 If no token is given, it will perform the SPNEGO authentication sequence using an
 HTTP OPTIONS request.
authenticate in interface Authenticatorurl - the URl to authenticate against.token - the authentication token being used for the user.IOException - if an IO error occurred.AuthenticationException - if an authentication error occurred.protected Authenticator getFallBackAuthenticator()
Authenticator will be used.
 
 This implementation returns a PseudoAuthenticator.
Authenticator.Copyright © 2008–2023 Apache Software Foundation. All rights reserved.