authzforce / server

AuthzForce Server (Multi-tenant XACML PDP/PAP - REST API)
https://authzforce-ce-fiware.rtfd.io/
GNU General Public License v3.0
56 stars 17 forks source link

Unable to send simple request in JSON format #33

Closed tresoldigiorgio closed 5 years ago

tresoldigiorgio commented 5 years ago

Im'm using Authzforce 8.0.1 on docker. I try to to send this request to pdp: { "Request" : { "ReturnPolicyIdList" : false } } and the response are: { "error":{ "message": "Invalid parameters: cvc-complex-type.4: Attribute 'ReturnPolicyIdList' must appear on element 'Request'." } } is a bug? I'm unable to send any type of request.

Thanks

cdanger commented 5 years ago

I assume you are using Content-Type application/json. In this case, you must add prefix @ to the JSON key when it corresponds to an attribute in the XACML/XML schema. You also need a CombinedDecision attribute and at least one Attributes element to be compliant with XACML schema.

For example:

{"Request":{"@ReturnPolicyIdList":"false","@CombinedDecision":"false","Attributes":{"@Category":"urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"}}}

For more JSON examples, check issue #27 .