public function getAuthorizationToken()
    {
        $authorizationToken = "Client-ID {$this->provider->getClientId()}";

        if (! is_null($this->token)) {
            // Validate if the token object link to this class is expire
            // refresh it if it's the case
            if ($this->token->hasExpired()) {
                $this->refreshToken();
            }

            $authorizationToken = "Bearer {$this->token->getToken()}";
        }

        return $authorizationToken;
    }
public function getAuthorizationToken()
    {
        $authorizationToken = "Client-ID {$this->provider->getClientId()}";

        if (! is_null($this->token)) {
            // Validate if the token object link to this class is expire
            // refresh it if it's the case
            if ($this->token->hasExpired()) {
                $this->refreshToken();
            }

            $authorizationToken = "Bearer {$this->token->getToken()}";
        }

        return $authorizationToken;
    }
public function getAuthorizationToken ( ) { $ authorizationToken = "Client-ID {$this->provider->getClientId()}" ; if ( ! is_null ( $ this -> token ) ) { // Validate if the token object link to this class is expire // refresh it if it's the case if ( $ this -> token -> hasExpired ( ) ) { $ this -> refreshToken ( ) ; } $ authorizationToken = "Bearer {$this->token->getToken()}" ; } return $ authorizationToken ; }
Generate the authorization string to pass in via the http header.
Check if a token is linked to the connection object and use the client ID if there is not.
The method will also refresh the access token if it has expired.

@return string
Generate the authorization string to pass in via the http header . Check if a token is linked to the connection object and use the client ID if there is not . The method will also refresh the access token if it has expired .