繁体   English   中英

在Fiware AuthZforce授权服务器中创建域时遇到问题

[英]Problems creating a domain in Fiware AuthZforce Authorization Server

我正在使用Fiware Enabler开发基于Oauth 2.0的身份验证/授权方案:Keyrock IdM,Wilma Proxy和AuthZforce授权服务器。

我安装并配置了Keyrock和Wilma,并且它们可以一起正常工作。

在同一台计算机上,我安装了AuthZForce。 Java OpenJDK 1.7.0_91和Tomcat 7安装在此计算机上的Ubuntu 14.04上。

我遵循了安装指南,并使用gdebi安装了AuthZforce,但实际上无法使用指南中的curl命令创建域:

curl --verbose --trace-ascii--请求POST \\ --header“内容类型: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“> <name> MyDomain </ name> <description>这是我的域。</ description> </ taz:domainProperties>'--header“ Accept:application / xml” http:// $ {MYSERVERHOST}:$ {MYPORT} / authzforce-ce / domains

我收到以下错误:

<?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}”。</ message> </ ns2:error>

看来是xml验证错误。 我尝试访问AuthZforce API,但程序员指南中的链接给出了404错误。

谁能建议如何解决此问题?

提前致谢。

我意识到我的最初答案被拒绝了,所以我将尝试提供一个更好的答案。 同时,新的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>

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 

用户指南中的更多信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM