2016-06-21 75 views
1

我需要針對IBM WebSphere服務器實現OAuth。爲此目的,我根據http://www.ibm.com/developerworks/websphere/techjournal/1305_odonnell2/1305_odonnell2.htmlWebSphere Docker OAuth

建起了碼頭工人的環境https://github.com/hhoechtl/websphere-oauth但是,如果我試圖得到一個令牌

curl -X POST -H "Accept-Charset: UTF-8" -H "Content-Type: application/x-www-form-urlencoded" -d 'grant_type=password&client_id=LibertyRocks&client_secret=AndMakesConfigurationEasy&username=admin&password=admin' "https://192.168.99.100:9443/oauth2/endpoint/DemoProvider/token" 

我得到的錯誤

{ 
    "error_description": "CWWKS1406E: The token request had an invalid client credential. The request URI was /oauth2/endpoint/DemoProvider/token.", 
    "error": "invalid_client" 
} 

但根據我server.xml中應該是正確的。我錯過了什麼?

回答

0

第二天它只是工作,不知道爲什麼。

1

你能打開並提供該調用的服務器跟蹤?該消息指示在請求中找不到任何憑證,或者找到憑證但對該客戶無效。知道這裏的情況是很有用的。

您可以通過添加這個片段到您的server.xml中啓用跟蹤:

<logging traceSpecification="*=info=enabled:com.ibm.ws.security.*=all=enabled:com.ibm.oauth.*=all=enabled" />