3

I'm using the following configuration: Apache/2.2.22 (Win32) PHP/5.4.17

When performing php sample I recieve the following error messages:

Notice: Undefined offset: 1 in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\class.aggcatauth.php on line 199 $ResponseKVPairs[$OneKVPair[0]] = $OneKVPair[1];

Notice: Undefined index: oauth_token in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\class.aggcatauth.php on line 202 $oauth_token = $ResponseKVPairs['oauth_token'];

Notice: Undefined index: oauth_token_secret in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\class.aggcatauth.php on line 203 $oauth_token_secret = $ResponseKVPairs['oauth_token_secret'];

Warning: Invalid argument supplied for foreach() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\example.php on line 65 foreach($xmlObj as $OneInstitution)

I assume the reason is empty tokens recieved (I checked this) from https://oauth.intuit.com/oauth/v1/get_access_token_by_saml

My Config.php:

<?php

define('SIMPLESAML_PATH',  'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/phplibs/simplesamlphp-1.11.0');
define('SIMPLEOAUTH_PATH',  'C:/Program Files (x86)/Apache Software Foundation/Apache2.2/htdocs/phplibs');

define('OAUTH_CONSUMER_KEY',   'qyprdM8VUKLwmWSytg83gPmnRSGLWJ');
define('OAUTH_SHARED_SECRET',  'yWdb7SHKubxEKxxFnkliGfDAKnehuwh9fkRmfAYk');

define('SAML_IDENTITY_PROVIDER_ID',  'accountingsuite.12359.cc.dev-intuit.ipp.prod');
define('SAML_X509_CERT_PATH',        'C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit keys\intuit.crt');
define('SAML_X509_PRIVATE_KEY_PATH', 'C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit keys\intuit.key');
define('SAML_NAME_ID',               '001');  // Up to you; just "keep track" of what you use

define('OAUTH_SAML_URL', 'https://oauth.intuit.com/oauth/v1/get_access_token_by_saml');
define('FINANCIAL_FEED_HOST', 'financialdatafeed.platform.intuit.com');
define('FINANCIAL_FEED_URL', 'https://'.FINANCIAL_FEED_HOST.'/');

require_once(SIMPLESAML_PATH . "/lib/xmlseclibs.php");
require_once(SIMPLESAML_PATH . "/lib/SimpleSAML/Utilities.php");
require_once(SIMPLEOAUTH_PATH . "/OAuthSimple.php");

Keys provided work great with C# example. (But I used p12 file).

So why it's not working? Looking forward for your answer.

Manas Mukherjee
  • 5,270
  • 3
  • 18
  • 30
Alex
  • 61
  • 1
  • Can you please try to use 'isset' to check if $ResponseKVPairs['oauth_token'] is already set. isset($ResponseKVPairs['oauth_token']) Please let me know if it removes this notice. – Manas Mukherjee Jul 15 '13 at 08:52
  • Used Isset. It fixed Notices, but it didn't fix the situation. Tokens are not recieved. Warning: Invalid argument supplied for foreach() in C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit_Original\example.php on line 65 foreach($xmlObj as $OneInstitution) The result is empty. – Alex Jul 15 '13 at 10:27
  • If possible plz share the code of example.php file. You can verify the .crt and .p12 files using apiexplorer https://developer.intuit.com/docs/0020_customeraccountdata/007_firstrequest Also check if the following steps are getting executed in SAML[though it is a ref frm java devkit.. but steps are same ] https://developer.intuit.com/docs/0020_customeraccountdata/devkits/0275_java_cad_devkit_1.0/0010_authorization#Define_SAML_Settings_in_the_Configuration_File#Step_1:_Create_the_OAuthAuthorizer_Object One last advise :) Plz ensure that php devkit is able to point to your pvt key file(p12/jks) – Manas Mukherjee Jul 15 '13 at 11:27
  • For the supplied example (https://github.com/pleslie/phpaggcat/), as I understand, I can't provide the password for p12 file, so I define the path to crt file. define('SAML_X509_PRIVATE_KEY_PATH', 'C:\Program Files (x86)\Apache Software Foundation\Apache2.2\htdocs\Intuit keys\intuit.key'); Is this correct? – Alex Jul 15 '13 at 11:38
  • .p12 file works in apiexplorer, but in this sample (config.php) I can't use it, because there is no field for the password. – Alex Jul 15 '13 at 11:47
  • It looks correct but I don't know how it works in php devkit. Sorry for that.I used java devkit and configured all values(including pwd and alias) in a config file[intuit-aggcat-config.xml]. – Manas Mukherjee Jul 15 '13 at 11:54
  • @Alex did you ever figure this out? I am getting the same error messages and I'm not sure how to resolve them. – David L Aug 01 '13 at 03:50

1 Answers1

2

I had trouble getting the PHP sample app up and working originally. After some debugging, here are the things I had to change to get it working:

• The OAuthSimple.php file was not part of the SimpleSAML package that I downloaded as instructed in the phpaggcat example. I found the OAuthSimple.php file here: OAuthSimple.php download.

• curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Changed from true to false in class.aggcatauth.php

• curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // Added this line in example.php curl options

• set_time_limit(120); // Added this at beginning of example.php because bank downloads were taking longer than the default of 30 seconds

• changed max_input_vars = 2500 in php.ini

Once I made those changes, I was able to connect with the API and get it working.

David L
  • 4,347
  • 3
  • 18
  • 30