2016-01-27 66 views
0

我正在使用Fiware Enabler:Keyrock IdM,Wilma Proxy和AuthZforce授權服務器開發基於Oauth 2.0的身份驗證/授權方案。在Fiware中創建域的問題AuthZforce授權服務器

我安裝並配置了Keyrock和Wilma,它們一起工作的很好。

在同一臺機器上我安裝了AuthZForce。這臺機器上的Ubuntu 14.04上安裝了Java OpenJDK 1.7.0_91和Tomcat 7。

我也跟着安裝嚮導,並與gdebi安裝AuthZforce,但我實際上並不能創建curl命令域中的指南中找到:

捲曲--verbose --trace-ascii的 - - 請求POST \ --header「Content-Type:application/xml; charset = UTF-8」 --data'<?xml version =「1.0」encoding =「UTF-8」? > < TAZ:domainProperties的xmlns:TAZ = 「http://authzforce.github.io/rest-api-model/xmlns/authz/4」 > <名> MYDOMAIN < /名稱> <描述>這是我的域名。 < /描述> </TAZ:domainProperties >' --header 「接受:應用程序/ XML的」 http:// $ {} MYSERVERHOST:$ {} MyPort上/ authzforce-CE /域

我得到了以下錯誤:

<?xml version =「1.0」encoding =「UTF-8」standalone =「yes」? > < ns2:error xmlns:ns2 =「http://authzforce.github.io/rest-api-model/xmlns/authz/4」xmlns:ns3 =「http://www.w3.org/2005/Atom 「xmlns:ns4 =」http://authzforce.github.io/core/xmlns/pdp/3.6「xmlns:ns5 =」http://authzforce.github.io/pap-dao-file/xmlns/properties/3.6 「> <消息>無效參數:cvc-complex-type.2.4.a:以"名稱"開頭的無效內容。發現無效的內容以元素"名稱"開頭。預計元素" {description,rootPolicyRef} "。 < /消息> </NS2:錯誤>

這似乎是一個XML驗證錯誤。我試圖訪問AuthZforce API,但程序員指南中的link給出了404錯誤。

任何人都可以建議如何解決這個問題?

在此先感謝。 〜

回答

0

我意識到我的初步答案被拒絕,所以我會盡力提供一個更好的答案。與此同時,新的AuthzForce版本已經發布,所以我在這裏爲您提供最新AuthzForce v5.4.1的實例。 (如果必要的話,請升級。) 爲簡單起見,讓我們寫XML負載到一個文件domainProperties.xml和curl命令重用:

$ cat domainProperties.xml 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<domainProperties xmlns="http://authzforce.github.io/rest-api-model/xmlns/authz/5" externalId="myOwnId"> 
    <description>This is my domain</description> 
</domainProperties> 

的外部ID是可選的,你可以將其設置爲你想要的任何別名用於使用新的域名。

curl命令雲:

$ curl --verbose --request "POST" --header "Content-Type: application/xml;charset=UTF-8" --data @domainProperties.xml --header "Accept: application/xml" http://localhost:8080/authzforce-ce/domains 

如果更換localhost您的主機名和8080以及服務器的端口,如果必要的。 響應應給人以新的域ID鏈接到新的域資源:在installation guide

... 
< HTTP/1.1 200 OK 
< Server: Authorization System 
< Date: Mon, 04 Aug 2016 13:00:12 GMT 
< Content-Type: application/xml 
< Transfer-Encoding: chunked 
< 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> 
<link xmlns="http://www.w3.org/2005/Atom" rel="item" href="h_D23LsDEeWFwqVFFMDLTQ" title="h_D23LsDEeWFwqVFFMDLTQ"/> 

更多信息。

您也可以使用外部ID拿回域名信息:在user guide

$ curl --verbose --request "GET" --header "Accept: application/xml" http://localhost:8080/authzforce-ce/domains?externalId=myOwnId 

更多信息。