solepixel / gravityforms-eloqua

Integrate Eloqua into Gravity Forms - Please see new supported version of this plugin!
https://briandichiara.com/product/gravityforms-eloqua/
GNU General Public License v2.0
13 stars 8 forks source link

Unable to connect plugin to Eloqua #22

Closed chieftechdog closed 5 years ago

chieftechdog commented 6 years ago

Hi Brian,

We started seeing this error last night on one of the sites we are using your plugin for:

Unable to connect to Eloqua. Invalid authentication credentials. (Invalid Connection String) Connection Failure

Attempting to use Refresh Token. object(Eloqua_API)#2762 (15) { ["urls"]=> NULL ["connection"]=> object(WP_Http)#2767 (0) { } ["connection_args"]=> array(2) { ["headers"]=> array(1) { ["Authorization"]=> string(62) "Basic RW1iYXJjYWRlcm9cV2ViRGV2LlNlbmNoYTp6WWM1NTEyYU5sNW8xYk4=" } ["timeout"]=> int(60) } ["authstring"]=> string(56) "RW1iYXJjYWRlcm9cV2ViRGV2LlNlbmNoYTp6WWM1NTEyYU5sNW8xYk4=" ["use_oauth"]=> bool(false) ["basic_auth_url"]=> string(27) "https://login.eloqua.com/id" ["rest_api_version"]=> string(3) "2.0" ["_oauth_authorize_url"]=> string(46) "https://login.eloqua.com/auth/oauth2/authorize" ["_oauth_token_url"]=> string(42) "https://login.eloqua.com/auth/oauth2/token" ["_oauth_client_id"]=> string(36) "11c8590a-f513-496a-aa9c-4a224dd92861" ["_oauth_client_secret"]=> string(100) "15325mypy7U2JFaTg35mF8ekItAyOdiOwfsZBx2dbHEECNecqSy9KK5ammgNlEhMwhhEav1te0hP8hdmQ1KaZjY1z9yQLlaGkQgP" ["_oauth_redirect_uri"]=> string(49) "https://api.briandichiara.com/gravityformseloqua/" ["_oauth_scope"]=> string(4) "full" ["errors"]=> array(1) { [0]=> string(115) "WP_Http Error: cURL error 60: SSL certificate problem: unable to get local issuer certificate (http_request_failed)" } ["last_response"]=> object(WP_Error)#2756 (2) { ["errors"]=> array(1) { ["http_request_failed"]=> array(1) { [0]=> string(78) "cURL error 60: SSL certificate problem: unable to get local issuer certificate" } } ["error_data"]=> array(0) { } } }

Perhaps there's some issue with the app configuration in Eloqua AppCloud or there's an issue with the redirect URI https://api.briandichiara.com/gravityformseloqua/? Any help is greatly appreciated!

DavidWright2018 commented 6 years ago

We are having the same issue. Anyone know what is happening?

I am using the beta version. When using simple authentication i get an error like above with SSL issue.

When i use OAuth its just refreshes and doesnt update or store details.

aaronware commented 6 years ago

While NOT a long term solution you can edit the connection config within the connect method of https://raw.githubusercontent.com/solepixel/gravityforms-eloqua/master/api/class.eloqua.api.php to not verify the SSL certificate

public function connect(){
        if( $this->init() )
            return true;
        $type = $this->use_oauth ? 'Bearer' : 'Basic';

        $this->connection_args = array(
            'headers' => array(
                'Authorization' => $type . ' ' . $this->authstring
            ),
            'sslverify' => false, // Temp disable of SSL Verify, this should not be disabled long term
        );
solepixel commented 6 years ago

I'm currently researching this issue. Thanks @aaronware I just discovered that as well and added it for future versions.

L01sLan3 commented 6 years ago

Do we need to update gravity forms to get this to work? Does this have anything to do with any of the emergency maintenance updates eloqua was supposed to do this weekend (I think they were anyway)?

Regards,

Stefanie

On Sun, Mar 11, 2018 at 3:09 PM, Brian DiChiara notifications@github.com wrote:

I'm currently researching this issue. Thanks @aaronware https://github.com/aaronware I just discovered that as well and added it for future versions.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/solepixel/gravityforms-eloqua/issues/22#issuecomment-372140492, or mute the thread https://github.com/notifications/unsubscribe-auth/AG6uempCbHhluLs7q14FNvBGx0_xCrU3ks5tdXaHgaJpZM4SlX6T .

solepixel commented 6 years ago

@chieftechdog @DavidWright2018 @aaronware @L01sLan3 Please download 1.6.0-delta and let me know if it resolves your issue. https://github.com/solepixel/gravityforms-eloqua/releases/tag/1.6.0-delta

solepixel commented 6 years ago

Also, keep in mind the repo hasn't been updated yet, mainly due to the release notes in 1.6.0-delta. The gravityforms-eloqua-1.6.0-delta.zip file is the one you want to download.

solepixel commented 6 years ago

@L01sLan3 It's always a good idea to keep Gravity Forms up-to-date. I'm not sure if the Eloqua maintenance updates are what affected the issue I discovered related to OAuth, but will address any new issues if they come up.

chieftechdog commented 6 years ago

@solepixel 1.6.0-delta version seems to work for us now.

One recommendation I have is to add a field on the settings screen that would let you specify the cURL timeout in seconds. We were often getting WP_Http Error: cURL error 28: Operation timed out after 5001 milliseconds with 0 bytes received (http_request_failed) error until we added the following code to gfeloqua.class.php on line 396:

curl_setopt( $ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt( $ch, CURLOPT_TIMEOUT, 10);