use of org.apache.hadoop.hive.metastore.security.DelegationTokenIdentifier in project presto by prestodb.
the class KerberosHiveMetastoreAuthentication method authenticateWithToken.
private TTransport authenticateWithToken(TTransport rawTransport, String tokenString) {
try {
Token<DelegationTokenIdentifier> token = new Token<>();
token.decodeFromUrlString(tokenString);
TTransport saslTransport = new TSaslClientTransport(TOKEN.getMechanismName(), null, null, SASL_DEFAULT_REALM, SASL_PROPERTIES, new SaslClientCallbackHandler(token), rawTransport);
return new TUGIAssumingTransport(saslTransport, UserGroupInformation.getCurrentUser());
} catch (IOException ex) {
throw new UncheckedIOException(ex);
}
}
use of org.apache.hadoop.hive.metastore.security.DelegationTokenIdentifier in project hive by apache.
the class SessionUtils method createToken.
/**
* Create a new token using the given string and service
*
* @param tokenStr
* @param tokenService
* @return
* @throws IOException
*/
private static Token<DelegationTokenIdentifier> createToken(String tokenStr, String tokenService) throws IOException {
Token<DelegationTokenIdentifier> delegationToken = new Token<DelegationTokenIdentifier>();
delegationToken.decodeFromUrlString(tokenStr);
delegationToken.setService(new Text(tokenService));
return delegationToken;
}
use of org.apache.hadoop.hive.metastore.security.DelegationTokenIdentifier in project hive by apache.
the class SecurityUtils method createToken.
/**
* Create a new token using the given string and service
*
* @param tokenStr
* @param tokenService
* @return
* @throws IOException
*/
private static Token<DelegationTokenIdentifier> createToken(String tokenStr, String tokenService) throws IOException {
Token<DelegationTokenIdentifier> delegationToken = new Token<DelegationTokenIdentifier>();
delegationToken.decodeFromUrlString(tokenStr);
delegationToken.setService(new Text(tokenService));
return delegationToken;
}
Aggregations