private function constructAPIToken() {
		if (isset($_REQUEST[self::CODE])) {
			$this->requestToken($_REQUEST[self::CODE], self::API_TOKEN);
			$_SESSION[self::SESSION][self::IS_API_TOKEN] = true;
			$_SESSION[self::SESSION][self::STATE] = self::NEGOTIATION_COMPLETE;
			header ("Location: {$_SESSION[self::SESSION][self::LANDING_PAGE]}");
			exit;
		} elseif (isset($_REQUEST[self::ERROR])) {
			$_SESSION[self::SESSION][self::STATE] = self::NEGOTIATION_FAILED;
			$_SESSION[self::SESSION][self::ERROR] = $_REQUEST[self::ERROR];
			header("Location: {$_SESSION[self::SESSION][self::LANDING_PAGE]}?error={$_REQUEST[self::ERROR]}");
			exit;
		} else {
			throw new OAuthNegotiator_Exception(
				'Unexpected OAuth response',
				OAuthNegotiator_Exception::CODE_RESPONSE
			);
		}
		
	}
private function constructAPIToken() {
		if (isset($_REQUEST[self::CODE])) {
			$this->requestToken($_REQUEST[self::CODE], self::API_TOKEN);
			$_SESSION[self::SESSION][self::IS_API_TOKEN] = true;
			$_SESSION[self::SESSION][self::STATE] = self::NEGOTIATION_COMPLETE;
			header ("Location: {$_SESSION[self::SESSION][self::LANDING_PAGE]}");
			exit;
		} elseif (isset($_REQUEST[self::ERROR])) {
			$_SESSION[self::SESSION][self::STATE] = self::NEGOTIATION_FAILED;
			$_SESSION[self::SESSION][self::ERROR] = $_REQUEST[self::ERROR];
			header("Location: {$_SESSION[self::SESSION][self::LANDING_PAGE]}?error={$_REQUEST[self::ERROR]}");
			exit;
		} else {
			throw new OAuthNegotiator_Exception(
				'Unexpected OAuth response',
				OAuthNegotiator_Exception::CODE_RESPONSE
			);
		}
		
	}
private function constructAPIToken ( ) { if ( isset ( $ _REQUEST [ self :: CODE ] ) ) { $ this -> requestToken ( $ _REQUEST [ self :: CODE ] , self :: API_TOKEN ) ; $ _SESSION [ self :: SESSION ] [ self :: IS_API_TOKEN ] = true ; $ _SESSION [ self :: SESSION ] [ self :: STATE ] = self :: NEGOTIATION_COMPLETE ; header ( "Location: {$_SESSION[self::SESSION][self::LANDING_PAGE]}" ) ; exit ; } elseif ( isset ( $ _REQUEST [ self :: ERROR ] ) ) { $ _SESSION [ self :: SESSION ] [ self :: STATE ] = self :: NEGOTIATION_FAILED ; $ _SESSION [ self :: SESSION ] [ self :: ERROR ] = $ _REQUEST [ self :: ERROR ] ; header ( "Location: {$_SESSION[self::SESSION][self::LANDING_PAGE]}?error={$_REQUEST[self::ERROR]}" ) ; exit ; } else { throw new OAuthNegotiator_Exception ( 'Unexpected OAuth response' , OAuthNegotiator_Exception :: CODE_RESPONSE ) ; } }
Construct an OAuthNegotiator to use an access code to request an API Token with matching user profile

@return void

@throws OAuthNegotiator_Exception CODE_RESPONSE if the prior request for an authorization token resulted in neither an authorization code or an error (weird!)
@throws OAuthNegotatior_Exception USER_RESPONSE if a user profile cannot be acquired to match the API access token (i.e. the OAuth server is probably not a Canvas instance)
Construct an OAuthNegotiator to use an access code to request an API Token with matching user profile