Gets the user name from the {@link ThreadLocal} variable.

@param conf Alluxio configuration
@return the client user in string
@throws AccessControlException there is no authenticated user for this thread or
the authentication is not enabled
323958
public static String getClientUser(AlluxioConfiguration conf) throws AccessControlException {
    try {
      User user = get(conf);
      if (user == null) {
        throw new AccessControlException(
            ExceptionMessage.AUTHORIZED_CLIENT_USER_IS_NULL.getMessage());
      }
      return user.getName();
    } catch (IOException e) {
      throw new AccessControlException(ExceptionMessage.AUTHENTICATION_IS_NOT_ENABLED.getMessage());
    }
  }
286057
public static String getUserNameInConf(Configuration jobConf)
			throws IllegalArgumentException {
		String userName = jobConf.get(Constants.USER_CONF_KEY_HADOOP2);
		if (StringUtils.isBlank(userName)) {
			userName = jobConf.get(Constants.USER_CONF_KEY);
			if (StringUtils.isBlank(userName)) {
				// neither user.name nor hadoop.mapreduce.job.user.name found
				throw new IllegalArgumentException(" Found neither "
						+ Constants.USER_CONF_KEY + " nor "
						+ Constants.USER_CONF_KEY_HADOOP2);
			}
		}
		return userName;
	}
166563
public static systemglobal_authenticationlocalpolicy_binding[] get_filtered(nitro_service service, String filter) throws Exception{
		systemglobal_authenticationlocalpolicy_binding obj = new systemglobal_authenticationlocalpolicy_binding();
		options option = new options();
		option.set_filter(filter);
		systemglobal_authenticationlocalpolicy_binding[] response = (systemglobal_authenticationlocalpolicy_binding[]) obj.getfiltered(service, option);
		return response;
	}
767809
private UserGroupInformation getCurrentUGI(HiveConf opConfig) throws HiveSQLException {
    try {
      return Utils.getUGI();
    } catch (Exception e) {
      throw new HiveSQLException("Unable to get current user", e);
    }
  }
95593
private function getAclAdapter() {
        $config = $this->getConfig();

        // Access control adapter
        $accessControl = $config['accessControl'];

        if (is_callable($accessControl) && !($accessControl instanceof AdapterInterface)) {
            $accessControl = $accessControl();
        }

        if (!$accessControl instanceof AdapterInterface) {
            throw new RuntimeException('Invalid access control adapter');
        }

        if (!$accessControl instanceof MutableAdapterInterface) {
            throw new RuntimeException('The configured access control adapter is not mutable');
        }

        return $accessControl;
    }
571016
public static InetSocketAddress getAddress(Configuration conf) {
    InetSocketAddress u = NameNode.getClientProtocolAddress(conf);
    int port = conf.getInt(AvatarNode.DFS_AVATARNODE_PORT_KEY, u.getPort() + 1);
    return new InetSocketAddress(u.getAddress(), port);
  }
906348
public static authenticationvserver_authenticationlocalpolicy_binding[] get(nitro_service service, String name) throws Exception{
		authenticationvserver_authenticationlocalpolicy_binding obj = new authenticationvserver_authenticationlocalpolicy_binding();
		obj.set_name(name);
		authenticationvserver_authenticationlocalpolicy_binding response[] = (authenticationvserver_authenticationlocalpolicy_binding[]) obj.get_resources(service);
		return response;
	}
1063189
@Override
    public String getUserName() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getUserName");
        String userName = jcaConnectionFactory.getUserName();
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getUserName", userName);
        return userName;
    }
651820
protected String getKeycloakUsername(final HttpServletRequest req, HttpServletResponse resp) {
        AtomicReference<String> username = new AtomicReference<>();
        Authenticator.authenticate(
            authConfiguration, req,
            subject -> {
                username.set(AuthHelpers.getUsername(subject));

                // Start httpSession
                req.getSession(true);
            }
        );
        return username.get();
    }
312099
public ApiResponse<UserEnvelope> getSelfWithHttpInfo() throws ApiException {
        com.squareup.okhttp.Call call = getSelfValidateBeforeCall(null, null);
        Type localVarReturnType = new TypeToken<UserEnvelope>(){}.getType();
        return apiClient.execute(call, localVarReturnType);
    }
806204
def get_access_id(self):
        
        access_id = self.get_as_nullable_string("access_id")
        access_id = access_id if access_id != None else self.get_as_nullable_string("client_id")
        return access_id
134057
protected String getUserInfoFromURL(ConvergedClientConfig config, SSLSocketFactory sslsf, String accessToken) {
        String url = config.getUserInfoEndpointUrl();
        boolean hostnameVerification = config.isHostNameVerificationEnabled();

        // https required by spec, use of http is not spec compliant
        if (!url.toLowerCase().startsWith("https:") && config.isHttpsRequired()) {
            Tr.error(tc, "OIDC_CLIENT_URL_PROTOCOL_NOT_HTTPS", new Object[] { url });
            return null;
        }

        OidcClientUtil oidccu = new OidcClientUtil();
        int statusCode = 0;
        String responseStr = null;
        try {
            boolean useSysProps = config.getUseSystemPropertiesForHttpClientConnections();
            Map<String, Object> resultMap = oidccu.getUserinfo(url, accessToken, sslsf, hostnameVerification, useSysProps);
            if (resultMap == null) {
                throw new Exception("result map from getUserinfo is null");
            }
            HttpResponse response = (HttpResponse) resultMap.get(ClientConstants.RESPONSEMAP_CODE);
            if (response == null) {
                throw new Exception("HttpResponse from getUserinfo is null");
            }
            statusCode = response.getStatusLine().getStatusCode();
            responseStr = EntityUtils.toString(response.getEntity(), "UTF-8");
        } catch (Exception ex) {
            //ffdc
        }
        if (statusCode != 200) {
            Tr.error(tc, "USERINFO_RETREIVE_FAILED", new Object[] { url, Integer.toString(statusCode), responseStr });
            return null;
        }
        return responseStr;
    }
1019984
public static String getLocalNodeName(AlluxioConfiguration conf) {
    switch (CommonUtils.PROCESS_TYPE.get()) {
      case JOB_MASTER:
        if (conf.isSet(PropertyKey.JOB_MASTER_HOSTNAME)) {
          return conf.get(PropertyKey.JOB_MASTER_HOSTNAME);
        }
        break;
      case JOB_WORKER:
        if (conf.isSet(PropertyKey.JOB_WORKER_HOSTNAME)) {
          return conf.get(PropertyKey.JOB_WORKER_HOSTNAME);
        }
        break;
      case CLIENT:
        if (conf.isSet(PropertyKey.USER_HOSTNAME)) {
          return conf.get(PropertyKey.USER_HOSTNAME);
        }
        break;
      case MASTER:
        if (conf.isSet(PropertyKey.MASTER_HOSTNAME)) {
          return conf.get(PropertyKey.MASTER_HOSTNAME);
        }
        break;
      case WORKER:
        if (conf.isSet(PropertyKey.WORKER_HOSTNAME)) {
          return conf.get(PropertyKey.WORKER_HOSTNAME);
        }
        break;
      default:
        break;
    }
    return getLocalHostName((int) conf.getMs(PropertyKey.NETWORK_HOST_RESOLUTION_TIMEOUT_MS));
  }
493802
public static String getCurrentUser() {
        ServiceContext ctx = ServiceContextStore.get();
        String currentUser;
        if (ctx == null) {
            currentUser = ServiceContextFactory.SYSTEM_USER;
        } else {
            currentUser = ctx.getUserId();
        }

        if (currentUser == null) {
            currentUser = ServiceContextFactory.UNKNOWN_USER;
        }
        return currentUser;
    }
930796
public static synchronized String getLocalHostName(int timeoutMs) {
    if (sLocalHost != null) {
      return sLocalHost;
    }

    try {
      sLocalHost = InetAddress.getByName(getLocalIpAddress(timeoutMs)).getCanonicalHostName();
      return sLocalHost;
    } catch (UnknownHostException e) {
      throw new RuntimeException(e);
    }
  }
1004975
@Override
	public String getName()
	{
		final InetSocketAddress remote = conn.getRemoteAddress();
		return "Local-DM " + remote.getAddress().getHostAddress() + ":" + remote.getPort();
	}
247831
@Programmatic
    public ApplicationUser newLocalUser(
            final String username,
            final Password password,
            final Password passwordRepeat,
            final ApplicationRole initialRole,
            final Boolean enabled,
            final String emailAddress) {
        ApplicationUser user = findByUsername(username);
        if (user == null) {
            user = getApplicationUserFactory().newApplicationUser();
            user.setUsername(username);
            user.setStatus(ApplicationUserStatus.parse(enabled));
            user.setAccountType(AccountType.LOCAL);
        }
        if (initialRole != null) {
            user.addRole(initialRole);
        }
        if (password != null) {
            user.updatePassword(password.getPassword());
        }
        if (emailAddress != null) {
            user.updateEmailAddress(emailAddress);
        }
        container.persistIfNotAlready(user);
        return user;
    }