Search in sources :

Example 11 with AuthenticationMethod

use of org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod in project hbase by apache.

the class TokenProvider method whoAmI.

@Override
public void whoAmI(RpcController controller, AuthenticationProtos.WhoAmIRequest request, RpcCallback<AuthenticationProtos.WhoAmIResponse> done) {
    AuthenticationProtos.WhoAmIResponse.Builder response = AuthenticationProtos.WhoAmIResponse.newBuilder();
    RpcServer.getRequestUser().ifPresent(requestUser -> {
        response.setUsername(requestUser.getShortName());
        AuthenticationMethod method = requestUser.getUGI().getAuthenticationMethod();
        if (method != null) {
            response.setAuthMethod(method.name());
        }
    });
    done.run(response.build());
}
Also used : AuthenticationMethod(org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod)

Aggregations

AuthenticationMethod (org.apache.hadoop.security.UserGroupInformation.AuthenticationMethod)11 IOException (java.io.IOException)3 Test (org.junit.Test)3 Configuration (org.apache.hadoop.conf.Configuration)2 YarnConfiguration (org.apache.hadoop.yarn.conf.YarnConfiguration)2 RMContextImpl (org.apache.hadoop.yarn.server.resourcemanager.RMContextImpl)2 RMApplicationHistoryWriter (org.apache.hadoop.yarn.server.resourcemanager.ahs.RMApplicationHistoryWriter)2 SystemMetricsPublisher (org.apache.hadoop.yarn.server.resourcemanager.metrics.SystemMetricsPublisher)2 RMStateStore (org.apache.hadoop.yarn.server.resourcemanager.recovery.RMStateStore)2 ContainerAllocationExpirer (org.apache.hadoop.yarn.server.resourcemanager.rmcontainer.ContainerAllocationExpirer)2 ResourceScheduler (org.apache.hadoop.yarn.server.resourcemanager.scheduler.ResourceScheduler)2 RMContainerTokenSecretManager (org.apache.hadoop.yarn.server.resourcemanager.security.RMContainerTokenSecretManager)2 Before (org.junit.Before)2 ArrayList (java.util.ArrayList)1 AuthMethod (org.apache.hadoop.security.SaslRpcServer.AuthMethod)1 UserGroupInformation (org.apache.hadoop.security.UserGroupInformation)1 ApplicationAttemptId (org.apache.hadoop.yarn.api.records.ApplicationAttemptId)1 ApplicationId (org.apache.hadoop.yarn.api.records.ApplicationId)1 ApplicationResourceUsageReport (org.apache.hadoop.yarn.api.records.ApplicationResourceUsageReport)1 ApplicationSubmissionContext (org.apache.hadoop.yarn.api.records.ApplicationSubmissionContext)1