0

Customer Account Data API のサンプル アプリをダウンロードします Tomcat に war ファイルを追加しました。ログインできましたが、getInstitutions が null を返しています。SampleApp.properties ファイルに Oauth ユーザー キー、ユーザー シークレット、SAML ID プロバイダー ID を追加しました。

intuit-aggcat-config.xml の内容、Tomcat および http ヘッダーからのエラーを以下に貼り付けます

=================intuit-aggcat-config.xml looks like this==============
<?xml version="1.0" encoding="ISO-8859-1" ?>
<intuit-config>
    <saml>
        <keystoreFile>e:\intuit\keystore.jks</keystoreFile>
        <keystorePassword>mypassword</keystorePassword>
        <keyPassword>mypassword</keyPassword>
        <certAlias>somealias</certAlias>
        <oAuthUrl>https://oauth.intuit.com/oauth/v1/get_access_token_by_saml</oAuthUrl>
    </saml>
</intuit-config>

==================Tomcat Logs====================================

URL path [/home.htm] onto handler 'homeController'
INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/login.htm] onto handler 'loginController'
INFO : org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping - Mapped URL path [/signOut.htm] onto handler 'loginController'
INFO : org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'aggcat': initialization completed in 1954 ms
INFO : com.intuit.aggcat.LoginController - LoginController -> showLoginPage()
INFO : com.intuit.aggcat.LoginController - LoginController -> authenticateUser()
INFO : com.intuit.aggcat.AggCatApiController - Reached fetchInstitutions
INFO : com.intuit.aggcat.AggCatApiController - Created AggCatService
INFO : com.intuit.aggcat.AggCatApiController - Failed to fetch institutions, null
===============Http headers=====================================


GET /AggCatSampleApp/login.htm HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Cookie: JSESSIONID=169482CCCF0786BA966F1CB0B2D1F00D
Connection: keep-alive

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Language: en-US
Content-Length: 1611
Date: Sun, 03 Feb 2013 12:52:24 GMT
----------------------------------------------------------
http localhost 8080/AggCatSampleApp/login.htm

POST /AggCatSampleApp/login.htm HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http localhost 8080/AggCatSampleApp/login.htm
Cookie: JSESSIONID=169482CCCF0786BA966F1CB0B2D1F00D
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 41
loginUserName=user&loginPassCode=password
HTTP/1.1 302 Found
Server: Apache-Coyote/1.1
Location: http localhost 8080/AggCatSampleApp/getInstitution.htm
Content-Language: en-US
Content-Length: 0
Date: Sun, 03 Feb 2013 12:52:33 GMT
----------------------------------------------------------
http localhost 8080/AggCatSampleApp/getInstitution.htm

GET /AggCatSampleApp/getInstitution.htm HTTP/1.1
Host: localhost:8080
User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:18.0) Gecko/20100101 Firefox/18.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
DNT: 1
Referer: http localhost 8080/AggCatSampleApp/login.htm
Cookie: JSESSIONID=169482CCCF0786BA966F1CB0B2D1F00D
Connection: keep-alive

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=ISO-8859-1
Content-Language: en-US
Content-Length: 2494
Date: Sun, 03 Feb 2013 12:52:33 GMT
----------------------------------------------------------

よろしく、キラン

4

1 に答える 1

1

intuit-aggcat-config.xml とキーストア (e:\intuit\keystore.jks にあります) の両方がクラスパスにあることを確認してください (ビルド クラス フォルダーでうまくいきます)。エラー報告があまり参考にならないことはすでにお気付きだと思います。独自のログ記録または出力を行う必要があります。次のように古い学校のデバッグを WebUtil.java クラスに追加して、プロパティ ファイルが読み取られていることを確認します。

public AggCatService getAggCatService(String userId){

    AggCatService service = null;
    try{
        System.out.println("Authorizing:");
        System.out.println("  OUTH_CONSUMER_KEY: " + OAUTH_CONSUMER_KEY);
        System.out.println("  OAUTH_CONSUMER_SECRET :" + OAUTH_CONSUMER_SECRET);
        System.out.println("  SAML_PROVIDER_ID :" + SAML_PROVIDER_ID);
        System.out.println("  User ID :" + userId);
        OAuthAuthorizer oauthAuthorizer = new OAuthAuthorizer(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, SAML_PROVIDER_ID,userId);
        System.out.println("OATH: " + oauthAuthorizer.toString());
        Context context = new Context(oauthAuthorizer);
        service= new AggCatService(context);
        System.out.println("Service: " + service.toString());

    }
    catch(AggCatException ex){
        System.out.println("Failed to authorize");
        System.out.println(ex.getMessage());
    }
    return service;

}

これを追加して (そして呼び出して) intuit-aggcat-config.xml も読み込まれるようにします。

public void status()
{
    System.out.println("Classpath = " + System.getProperty("java.class.path"));
    System.out.println("Working Directory = " + System.getProperty("user.dir"));
    System.out.println("Keystore File = " + Config.getProperty("saml.keystoreFile"));
    System.out.println("Keystore Password = " + Config.getProperty("saml.keystorePassword"));
    System.out.println("Key Password = " + Config.getProperty("saml.keyPassword"));
    System.out.println("Cert Alias = " + Config.getProperty("saml.certAlias"));
    System.out.println("Base URL = " + Config.getProperty("baseURL.aggcat"));
}
于 2013-02-07T16:30:58.020 に答える