xml - Problems creating a domain in Fiware AuthZforce Authorization Server -
i'm developing authentication/authorization scheme, based on oauth 2.0, using fiware enablers: keyrock idm, wilma proxy , authzforce authorizaton server.
i installed , configured keyrock , wilma , work fine together.
on same machine installed authzforce. java openjdk 1.7.0_91 , tomcat 7 installed on ubuntu 14.04 on machine.
i followed installation guide , installed authzforce gdebi, can't create domain curl command found in guide:
curl --verbose --trace-ascii - --request 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"> <name>mydomain</name><description>this domain.</description></taz:domainproperties>' --header "accept: application/xml" http://${myserverhost}:${myport}/authzforce-ce/domains
i got following error:
<?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"><message>invalid parameters: cvc-complex-type.2.4.a: invalid content starting "name". invalid content found starting element "name". element "{description, rootpolicyref}" expected.</message></ns2:error>
it seems xml validation error. tried access authzforce api link in the programmer's guide gives 404 error.
can suggest how fix issue?
thanks in advance. ~
i realized initial answer rejected, i'll try provide better one. in meantime, new authzforce releases have come out, give here working example latest authzforce v5.4.1. (please upgrade if necessary.) simplicity, let's write xml payload file domainproperties.xml
, reuse in curl command:
$ 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 domain</description> </domainproperties>
the externalid optional , can set alias want use use new domain.
the curl command goes:
$ 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
replace localhost
if hostname , 8080
server port if necessary. response should give link new domain resource new domain 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"/>
more info in installation guide.
you can use externalid domain info:
$ curl --verbose --request "get" --header "accept: application/xml" http://localhost:8080/authzforce-ce/domains?externalid=myownid
more info in user guide.
Comments
Post a Comment