Search in sources :

Example 1 with PseudoDelegationTokenAuthenticator

use of org.apache.hadoop.security.token.delegation.web.PseudoDelegationTokenAuthenticator in project hadoop by apache.

the class TimelineConnector method serviceInit.

@Override
protected void serviceInit(Configuration conf) throws Exception {
    super.serviceInit(conf);
    ClientConfig cc = new DefaultClientConfig();
    cc.getClasses().add(YarnJacksonJaxbJsonProvider.class);
    sslFactory = getSSLFactory(conf);
    connConfigurator = getConnConfigurator(sslFactory);
    if (UserGroupInformation.isSecurityEnabled()) {
        authenticator = new KerberosDelegationTokenAuthenticator();
    } else {
        authenticator = new PseudoDelegationTokenAuthenticator();
    }
    authenticator.setConnectionConfigurator(connConfigurator);
    connectionRetry = new TimelineClientConnectionRetry(conf);
    client = new Client(new URLConnectionClientHandler(new TimelineURLConnectionFactory(authUgi, authenticator, connConfigurator, token, doAsUser)), cc);
    if (requireConnectionRetry) {
        TimelineJerseyRetryFilter retryFilter = new TimelineJerseyRetryFilter(connectionRetry);
        client.addFilter(retryFilter);
    }
}
Also used : DefaultClientConfig(com.sun.jersey.api.client.config.DefaultClientConfig) PseudoDelegationTokenAuthenticator(org.apache.hadoop.security.token.delegation.web.PseudoDelegationTokenAuthenticator) URLConnectionClientHandler(com.sun.jersey.client.urlconnection.URLConnectionClientHandler) ClientConfig(com.sun.jersey.api.client.config.ClientConfig) DefaultClientConfig(com.sun.jersey.api.client.config.DefaultClientConfig) Client(com.sun.jersey.api.client.Client) KerberosDelegationTokenAuthenticator(org.apache.hadoop.security.token.delegation.web.KerberosDelegationTokenAuthenticator)

Aggregations

Client (com.sun.jersey.api.client.Client)1 ClientConfig (com.sun.jersey.api.client.config.ClientConfig)1 DefaultClientConfig (com.sun.jersey.api.client.config.DefaultClientConfig)1 URLConnectionClientHandler (com.sun.jersey.client.urlconnection.URLConnectionClientHandler)1 KerberosDelegationTokenAuthenticator (org.apache.hadoop.security.token.delegation.web.KerberosDelegationTokenAuthenticator)1 PseudoDelegationTokenAuthenticator (org.apache.hadoop.security.token.delegation.web.PseudoDelegationTokenAuthenticator)1