From ccea8f5e58857d9972655b146278b45df46ec987 Mon Sep 17 00:00:00 2001 From: Brinda Sivalingam Date: Fri, 29 May 2020 08:45:06 -0700 Subject: [PATCH] Revert OAuth Logging changes. --- src/Core/OAuth/OAuth2/OAuth2LoginHelper.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/Core/OAuth/OAuth2/OAuth2LoginHelper.php b/src/Core/OAuth/OAuth2/OAuth2LoginHelper.php index b8538085..8e5ddc1d 100644 --- a/src/Core/OAuth/OAuth2/OAuth2LoginHelper.php +++ b/src/Core/OAuth/OAuth2/OAuth2LoginHelper.php @@ -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()); @@ -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()); @@ -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()); @@ -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()); @@ -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());