Skip to content

Commit

Permalink
Merge pull request #320 from intuit/hot-fix
Browse files Browse the repository at this point in the history
Revert OAuth Logging changes.
  • Loading branch information
bsivalingam authored May 29, 2020
2 parents 1700b72 + ccea8f5 commit 539ba21
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Core/OAuth/OAuth2/OAuth2LoginHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,9 @@ public function exchangeAuthorizationCodeForToken($code, $realmID){
'Authorization' => $authorizationHeaderInfo,
'Content-Type' => 'application/x-www-form-urlencoded'
);
$this->LogAPIRequestToLog(http_build_query($parameters), CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, $http_header);
// $this->LogAPIRequestToLog(http_build_query($parameters), CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, $http_header);
$intuitResponse = $this->curlHttpClient->makeAPICall(CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, CoreConstants::HTTP_POST, $http_header, http_build_query($parameters), null, true);
$this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
// $this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
$this->faultHandler = $intuitResponse->getFaultHandler();
if($this->faultHandler) {
throw new ServiceException("Exchange Authorization Code for Access Token failed. Body: [" . $this->faultHandler->getResponseBody() . "].", $this->faultHandler->getHttpStatusCode());
Expand All @@ -281,9 +281,9 @@ public function refreshToken(){
$refreshToken = $this->getAccessToken()->getRefreshToken();
$http_header = $this->constructRefreshTokenHeader();
$requestBody = $this->constructRefreshTokenBody($refreshToken);
$this->LogAPIRequestToLog($requestBody, CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, $http_header);
// $this->LogAPIRequestToLog($requestBody, CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, $http_header);
$intuitResponse = $this->curlHttpClient->makeAPICall(CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, CoreConstants::HTTP_POST, $http_header, $requestBody, null, true);
$this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
// $this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
$this->faultHandler = $intuitResponse->getFaultHandler();
if($this->faultHandler) {
throw new ServiceException("Refresh OAuth 2 Access token with Refresh Token failed. Body: [" . $this->faultHandler->getResponseBody() . "].", $this->faultHandler->getHttpStatusCode());
Expand All @@ -301,9 +301,9 @@ public function refreshToken(){
public function refreshAccessTokenWithRefreshToken($refreshToken){
$http_header = $this->constructRefreshTokenHeader();
$requestBody = $this->constructRefreshTokenBody($refreshToken);
$this->LogAPIRequestToLog($requestBody, CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, $http_header);
// $this->LogAPIRequestToLog($requestBody, CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, $http_header);
$intuitResponse = $this->curlHttpClient->makeAPICall(CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, CoreConstants::HTTP_POST, $http_header, $requestBody, null, true);
$this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
// $this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
$this->faultHandler = $intuitResponse->getFaultHandler();
if($this->faultHandler) {
throw new ServiceException("Refresh OAuth 2 Access token with Refresh Token failed. Body: [" . $this->faultHandler->getResponseBody() . "].", $this->faultHandler->getHttpStatusCode());
Expand Down Expand Up @@ -333,9 +333,9 @@ public function revokeToken($accessTokenOrRefreshToken){
'Authorization' => $authorizationHeaderInfo,
'Content-Type' => 'application/json'
);
$this->LogAPIRequestToLog($parameters, CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, $http_header);
// $this->LogAPIRequestToLog($parameters, CoreConstants::OAUTH2_TOKEN_ENDPOINT_URL, $http_header);
$intuitResponse = $this->curlHttpClient->makeAPICall(CoreConstants::REVOCATION_ENDPONT, CoreConstants::HTTP_POST, $http_header, json_encode($parameters), null, true);
$this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
// $this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
$this->faultHandler = $intuitResponse->getFaultHandler();
if($this->faultHandler) {
throw new ServiceException("Revoke Token failed. Body: [" . $this->faultHandler->getResponseBody() . "].", $this->faultHandler->getHttpStatusCode());
Expand Down Expand Up @@ -366,9 +366,9 @@ public function getUserInfo($accessToken = null, $env = "production"){
'Authorization' => 'Bearer ' . $accessToken
);

$this->LogAPIRequestToLog(null, $url, $http_header);
// $this->LogAPIRequestToLog(null, $url, $http_header);
$intuitResponse = $this->curlHttpClient->makeAPICall($url, CoreConstants::HTTP_GET, $http_header, null, null, true);
$this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
// $this->LogAPIResponseToLog($intuitResponse->getBody(), $requestUri, $intuitResponse->getHeaders());
$this->faultHandler = $intuitResponse->getFaultHandler();
if($this->faultHandler) {
throw new ServiceException("Get UrerInfo failed. Body: [" . $this->faultHandler->getResponseBody() . "].", $this->faultHandler->getHttpStatusCode());
Expand Down

0 comments on commit 539ba21

Please sign in to comment.