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());
}
Aggregations