我正在开发一个基于OAuth2.0的身份验证/授权方案,使用Fiware启用器: Keyrock IdM、Wilma代理和AuthZforce authorizaton服务器。
我安装并配置了Keyrock和Wilma,它们一起工作得很好。
在我安装AuthZForce的同一台机器上。Java OpenJDK 1.7.0_91和Tomcat 7安装在这台机器上的Ubuntu14.04上。
我按照安装指南安装了AuthZforce,但实际上无法使用指南中的curl命令创建域:
curl -详细的跟踪-ascii-请求POST \-标头-类型:application/xml;charset=UTF-8-数据'">http://authzforce.github.io/rest-api-model/xmlns/authz/4"> MyDomainThis是我的域。‘-header“接受: application/xml”http://${MYSERVERHOST}:${MYPORT}/authzforce-ce/domains“
我得到了以下错误:
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-name.2.4.a:以"name”开头的无效内容。找到以元素"name“开头的无效内容。需要一个元素"{description,rootPolicyRef}”。
这似乎是一个xml验证错误。我试图访问AuthZforce API,但是程序员指南中的链接给出了一个404错误。
有人能建议如何解决这个问题吗?
提前谢谢。~
发布于 2016-11-14 11:18:03
我意识到我的最初答案被拒绝了,所以我会尝试提供一个更好的答案。同时,新的AuthzForce版本已经发布,所以我在这里给您一个最新的AuthzForce版本5.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>externalId是可选的,您可以将它设置为要用于新域的任何别名。
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提供一个指向新域资源的链接:
...
< 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"/>更多信息在安装指南。
您还可以使用externalId获取域信息:
$ curl --verbose --request "GET" --header "Accept: application/xml" http://localhost:8080/authzforce-ce/domains?externalId=myOwnId 更多信息在用户指南。
https://stackoverflow.com/questions/35041575
复制相似问题