Get the authority

@return string|null Returns the authority or null if not set.
975018
public function getAuthority()
    {
        $authority = null;

        if (null !== $this->host) {

            if (null !== $this->userinfo) {
                $authority .= $this->userinfo . '@';
            }
            $authority .= $this->host;
            if (null !== $this->port) {
                $authority .= ':' . $this->port;
            }
        }

        return $authority;
    }
958764
public function getAuthKey()
    {
        $authKeyAttribute = $this->authKeyAttribute;
        return (is_string($authKeyAttribute) && !empty($authKeyAttribute)) ? $this->$authKeyAttribute : null;
    }
998968
public function getAccessToken()
    {
        if ($this->accessToken && $this->accessToken->isExpired()) {
            // The access token has expired.
            $this->accessToken = null;
        }

        if (null === $this->accessToken) {
            // Try to acquire a new access token from the server.
            $this->accessToken = $this->acquireAccessToken();
            if ($this->accessToken) {
                $this->refreshToken = $this->accessToken->getRefreshToken() ?: null;
            }
        }

        return $this->accessToken;
    }
115961
public function getAuthentication()
    {
        if ($this->useAgent) {
            return $this->getAgent();
        }

        if ($this->privateKey) {
            return $this->getPrivateKey();
        }

        return $this->getPassword();
    }
1304019
public function getAuthorNameAttribute()
    {
        $attribute = config('forum.integration.user_name');

        if (!is_null($this->author)) {
            return $this->author->$attribute;
        }

        return null;
    }
556562
public function getUserAgent()
    {
        if ($this->USER_AGENT) {
            return $this->USER_AGENT;
        }

        if ($this->HTTP_USER_AGENT) {
            return $this->HTTP_USER_AGENT;
        }

        return null;
    }
87931
public function getValidAuthResult()
    {
        $authResult = $this->_stateMgr->get('authResult');
        /* @var AuthResult $authResult */
        if ($authResult && $authResult->isFresh($this->_config->timeout)) {
            return $authResult;
        }
        return null;
    }
891613
protected function getAuthority()
    {
        if ($this->authority instanceof Model) {
            return $this->authority;
        }

        return Models::role()->firstOrCreate(['name' => $this->authority]);
    }
800223
public function userId()
	{
		if (isset($this->user_id)) {
			return $this->user_id ? $this->user_id : null;
		}
		
		$this->check();
		$this->user_id = false;
		
		if ('user' == $this->type) {
			if ($user_id = Authorizer::getResourceOwnerId()) {
				return $this->user_id = $user_id;
			}
		}
		
		return null;
	}
1050464
public function findAuthenticatedUser()
    {

        $token = $this->getSecurityTokenStorage()->getToken();

        if (null !== $token) {

            $user = $token->getUser();

            if (is_object($user) && $user instanceof UserInterface) {
                return $user;
            }

        }
        return null;
    }
747392
protected function buildAuthorityStr()
    {
        if ($this->host != null) {
            $authority = '//';
            if ($this->userInfo != null) {
                $authority .= $this->userInfo . '@';
            }
            $flag = (strpos($this->host, ':') !== false) && !(substr($this->host, 0,
                        1) == '[') && !(substr($this->host, -1) == ']');
            if ($flag) {
                $authority .= '[';
            }
            $authority .= $this->host;
            if ($flag) {
                $authority .= ']';
            }
            if ($this->port != null) {
                $authority .= ':' . $this->port;
            }
            return $authority;
        } else {
            if ($this->scheme) {
                return '//' . $this->authority;
            } else {
                return $this->authority;
            }
        }
    }
1366884
public function getAccessToken()
    {
        if (null === $this->accessTokens) {
            $this->accessTokens = [];
        }

        if (!array_key_exists($this->getRegion(), $this->accessTokens)) {
            $this->accessTokens[$this->getRegion()] = $this->requestAccessToken();
        }

        return $this->accessTokens[$this->getRegion()]->getToken();
    }
85859
protected function controlAccessAccount()
    {
        $account_id = $this->url->getAccountId();

        if ($account_id === false || $this->uid === $account_id) {
            return null;
        }

        if ($this->isSuperadmin($account_id) && !$this->isSuperadmin()) {
            $this->setHttpStatus(403);
            return null;
        }

        if (!$this->access('user')) {
            $this->setHttpStatus(403);
        }
    }
258675
public function getAuthority()
    {
        $scheme = $this->getScheme();
        $serverName = $this->getHost();
        $serverPort = $this->getPort();

        $authority = sprintf('%s://%s', $scheme, $serverName);
        if (('https' === $scheme && 443 !== $serverPort) || ('http' === $scheme && 80 !== $serverPort)) {
            $authority .= sprintf(':%d', $serverPort);
        }

        return $authority;
    }
306955
public function authenticate()
    {
        $u = $this->authenticateBySession();
        if ($u) {
            return $u;
        }

        $u = $this->authenticateByToken();
        if ($u) {
            return $u;
        }

        return null;
    }
1147027
public function getUser()
    {
        /** @var AbstractAdmin $admin */
        $admin = $this;

        $container = $admin->getContainer();

        if (!$container->has('security.token_storage')) {
            return null;
        }

        $tokenStorage = $container->get('security.token_storage');

        if (null === $token = $tokenStorage->getToken()) {
            return null;
        }

        if (!\is_object($user = $token->getUser())) {
            // e.g. anonymous authentication
            return null;
        }

        return $user;
    }
746606
public function getAccessToken()
  {
    $token = $this->getAuth()->getAccessToken();
    // The response is json encoded, so could be the string null.
    // It is arguable whether this check should be here or lower
    // in the library.
    return (null == $token || 'null' == $token || '[]' == $token) ? null : $token;
  }