public function authenticate($grantType = 'client_credentials')
    {
        if ($grantType == 'client_credentials') {
            $cc = new oAuthClientCredentials;
            $this->authorization = $cc->clientCredentials();
        } elseif ($grantType = 'authorization_code') {
            // Authentication has already taken place so we just need an instance of authCode
            // that has the necessary credentials
            $this->authorization = new oAuthAuthorizationCode();
        } else {
            // Unknown grant type
            return false;
        }

        return $this;
    }
public function authenticate($grantType = 'client_credentials')
    {
        if ($grantType == 'client_credentials') {
            $cc = new oAuthClientCredentials;
            $this->authorization = $cc->clientCredentials();
        } elseif ($grantType = 'authorization_code') {
            // Authentication has already taken place so we just need an instance of authCode
            // that has the necessary credentials
            $this->authorization = new oAuthAuthorizationCode();
        } else {
            // Unknown grant type
            return false;
        }

        return $this;
    }
public function authenticate ( $ grantType = 'client_credentials' ) { if ( $ grantType == 'client_credentials' ) { $ cc = new oAuthClientCredentials ; $ this -> authorization = $ cc -> clientCredentials ( ) ; } elseif ( $ grantType = 'authorization_code' ) { // Authentication has already taken place so we just need an instance of authCode // that has the necessary credentials $ this -> authorization = new oAuthAuthorizationCode ( ) ; } else { // Unknown grant type return false ; } return $ this ; }
Authenticate to the API and get a token

@param string $grantType
Authenticate to the API and get a token