2013-07-15 25 views
3

: 阿帕奇/ 2.2.22的(Win32)PHP/5.4.17aggcat PHP樣品不工作

當執行PHP的樣本I收到以下錯誤消息:

通知:未定義偏移:1 C:\程序文件(x86)\ Apache軟件基金會\ APACHE2.2 \ htdocs中\ Intuit_Original \ class.aggcatauth.php上線199個 $ ResponseKVPairs [$ OneKVPair [0]] = $ OneKVPair [1];

注意:未定義指數:組oauth_token在C:\ Program Files文件(x86)的\ Apache軟件基金會\ APACHE2.2 \ htdocs中\ Intuit_Original \ class.aggcatauth.php上線202 $組oauth_token = $ ResponseKVPairs [」組oauth_token'];

注意:未定義指數:oauth_token_secret在C:\ Program Files文件(x86)的\ Apache軟件基金會\ APACHE2.2 \ htdocs中\ Intuit_Original \ class.aggcatauth.php上線203 $ oauth_token_secret = $ ResponseKVPairs [」 oauth_token_secret'];

警告:在C的foreach()提供的參數無效:\程序文件(x86)\ Apache軟件基金會\ APACHE2.2 \ htdocs中\ Intuit_Original \使用example.php第65行 的foreach($ xmlObj爲$ OneInstitution)

我認爲原因是收到空令牌(我查了這一點)從https://oauth.intuit.com/oauth/v1/get_access_token_by_saml

我的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"); 

提供的鍵在C#示例中非常有用。 (但我用p12文件)。

那麼爲什麼它不工作?期待您的回答。

+0

你可以請嘗試使用'isset'來檢查是否已經設置了$ ResponseKVPairs ['oauth_token']。 isset($ ResponseKVPairs ['oauth_token']) 請讓我知道,如果它刪除此通知。 –

+0

使用Isset。它修正了通知,但沒有解決這個問題。代幣沒有收到。警告:在第65行foreach($ xmlObj as $ OneInstitution)中爲C:\ Program Files(x86)\ Apache Software Foundation \ Apache2.2 \ htdocs \ Intuit_Original \ example.php中的foreach()提供的無效參數結果爲空。 – Alex

+0

如果可能的話,分享一下example.php文件的代碼。您可以使用apiexplorer驗證.crt和.p12文件https://developer.intuit.com/docs/0020_customeraccountdata/007_firstrequest同時檢查以下步驟是否在SAML中執行[雖然它是一個ref frm java devkit ..但步驟同] 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 最後一個提醒:) PLZ確保PHP的devkit能夠指向您的PVT密鑰文件(p12/jks) –

回答

2

我很難讓PHP示例應用程序啓動並正常工作。經過一些調試後,我必須改變以使其正常工作:

•OAuthSimple.php文件不是我按照phpaggcat example中的說明下載的SimpleSAML軟件包的一部分。我在這裏找到了OAuthSimple.php文件:OAuthSimple.php download

•curl_setopt($ CH,CURLOPT_SSL_VERIFYPEER,FALSE); //從true更改爲false class.aggcatauth.php

•curl_setopt($ CH,CURLOPT_SSL_VERIFYPEER,FALSE); //在example.php中添加了這一行卷曲選項

•set_time_limit(120); //在使用example.php年初增加了這一點,因爲銀行下載超過了30秒

•改變max_input_vars默認需要更長的時間= 2500在php.ini

一旦我做了這些變化,我能夠連接與API和讓它工作。