Zendesk\API\HttpClient::setAuth PHP Method

setAuth() public method

Configure the authorization method
public setAuth ( $strategy, array $options )
$strategy
$options array
    public function setAuth($strategy, array $options)
    {
        $this->auth = new Auth($strategy, $options);
    }

Usage Example

 /**
  * Sets up the fixture, for example, open a network connection.
  * This method is called before a test is executed.
  */
 protected function setUp()
 {
     $this->client = new HttpClient($this->subdomain, $this->username, $this->scheme, $this->hostname, $this->port);
     $authOptions['username'] = $this->username;
     if ($this->authStrategy === 'basic') {
         $authOptions['token'] = $this->token;
     } else {
         $authOptions['token'] = $this->oAuthToken;
     }
     $this->client->setAuth($this->authStrategy, $authOptions);
 }
All Usage Examples Of Zendesk\API\HttpClient::setAuth