public function fetchAccessToken($code)
    {
        $this->validateTokenParams();

        $this->oauth2->tokenUrl = $this->tokenUrl;
        $this->oauth2->clientId = $this->clientId;
        $this->oauth2->clientSecret = $this->clientSecret;

        try {
            $response = $this->oauth2->fetchAccessToken($code);
        } catch (Exception $ex) {
            throw new Oauth2ClientException($ex->getMessage());
        }
        return $this->handleTokenResponse($response);
    }
public function fetchAccessToken($code)
    {
        $this->validateTokenParams();

        $this->oauth2->tokenUrl = $this->tokenUrl;
        $this->oauth2->clientId = $this->clientId;
        $this->oauth2->clientSecret = $this->clientSecret;

        try {
            $response = $this->oauth2->fetchAccessToken($code);
        } catch (Exception $ex) {
            throw new Oauth2ClientException($ex->getMessage());
        }
        return $this->handleTokenResponse($response);
    }
public function fetchAccessToken ( $ code ) { $ this -> validateTokenParams ( ) ; $ this -> oauth2 -> tokenUrl = $ this -> tokenUrl ; $ this -> oauth2 -> clientId = $ this -> clientId ; $ this -> oauth2 -> clientSecret = $ this -> clientSecret ; try { $ response = $ this -> oauth2 -> fetchAccessToken ( $ code ) ; } catch ( Exception $ ex ) { throw new Oauth2ClientException ( $ ex -> getMessage ( ) ) ; } return $ this -> handleTokenResponse ( $ response ) ; }
Fetches the access token using the authorization code
@author Adegoke Obasa <goke@cottacush.com>
@param $code
@return mixed Access token
@throws Oauth2ClientException
Fetches the access token using the authorization code