2017-03-19 17 views
0

신원 서버 내 게시 된 정책은 다음과 같습니다 여기 WSO2 Identity Server를 XACML JSON 요청 결과는 [찾을 수 없습니다 AttributeDesignator 속성] 내가 POSTMAN</p> 여기 <p>를 사용 WSO2 자격 엔드 포인트에 JSON 요청을 보내려고 생각

<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="samplePolicy" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-overrides" Version="1.0"> 
    <Target> 
     <AnyOf> 
      <AllOf> 
       <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> 
        <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string"> 
              read 
             </AttributeValue> 
        <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"/> 
       </Match> 
      </AllOf> 
     </AnyOf> 
    </Target> 
    <Rule Effect="Permit" RuleId="permit"/> 

는 JSON 요청이다는 내가 보내

{ 
    "Request": { 
     "Action": { 
      "Attribute": [ 
       { 
        "AttributeId": "urn:oasis:names:tc:xacml:1.0:action:action-id", 
        "Value": "read" 
       } 
      ] 
     }, 
     "Resource": { 
      "Attribute": [ 
       { 
        "AttributeId": "urn:oasis:names:tc:xacml:1.0:resource:resource-id", 
        "Value": "http://127.0.0.1/service/very_secure/" 
       } 
      ] 
     } 
    } 
} 

코드의 두 블록이 블로그에서 온 https://medium.com/@gdrdabarera/how-entitlement-management-works-with-rest-api-via-xacml-in-wso2-identity-server-5-3-0-7a60940d040c#.4lxgiw6tn

그러나 나는 또한 내 자신의 정책과 요청을 시도하지만 난 항상 같은 응답

을 얻을

Postman response screenshot

나는 항상 내게 줄려고 상관없이 "불확정"응답 무엇을 것입니다 에?

답변

2

으로 고정 :

XACML 요청 :

{ 
    "Request": { 
     "Action": { 
      "Attribute": [ 
       { 
        "AttributeId": "urn:oasis:names:tc:xacml:1.0:action:action-id", 
        "Value": "read" 
       } 
      ] 
     }, 
     "Resource": { 
      "Attribute": [ 
       { 
        "AttributeId": "urn:oasis:names:tc:xacml:1.0:resource:resource-id", 
        "Value": "http://127.0.0.1/service/very_secure/" 
       } 
      ] 
     } 
    } 
} 

XACML과 테스트

<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="samplePolicyforJSON" RuleCombiningAlgId="urn:oasis:names:tc:xacml:3.0:rule-combining-algorithm:deny-overrides" Version="1.0"> 
    <Target> 
     <AnyOf> 
     <AllOf> 
      <Match MatchId="urn:oasis:names:tc:xacml:1.0:function:string-equal"> 
       <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue> 
       <AttributeDesignator AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action" DataType="http://www.w3.org/2001/XMLSchema#string" MustBePresent="true"></AttributeDesignator> 
      </Match> 
     </AllOf> 
     </AnyOf> 
    </Target> 
    <Rule Effect="Permit" RuleId="permit"></Rule> 
</Policy> 

: 이전과 XML 정책에서 "읽기"속성 값 뒤에 공백을 제거 응답 :

{ 
    "Response": [ 
    { 
     "Decision": "Permit", 
     "Status": { 
     "StatusCode": { 
      "Value": "urn:oasis:names:tc:xacml:1.0:status:ok" 
     } 
     } 
    } 
    ] 
} 

과 함께 :

XACML 요청 :

<Request xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" CombinedDecision="false" ReturnPolicyIdList="false"> 
    <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:resource"> 
     <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:resource:resource-id" IncludeInResult="false"> 
      <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">http://localhost/secureAccess/resource</AttributeValue> 
     </Attribute> 
    </Attributes> 
    <Attributes Category="urn:oasis:names:tc:xacml:3.0:attribute-category:action"> 
     <Attribute AttributeId="urn:oasis:names:tc:xacml:1.0:action:action-id" IncludeInResult="false"> 
      <AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">read</AttributeValue> 
     </Attribute> 
    </Attributes> 
</Request> 

XACML 응답 : 정확하게 모든 단계를 따라하면

<Response xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17"> 
    <Result> 
     <Decision>Permit</Decision> 
     <Status> 
      <StatusCode Value="urn:oasis:names:tc:xacml:1.0:status:ok"/> 
     </Status> 
    </Result> 
</Response> 
+0

실제로 추가 공간은 내 정책에 없습니다. 내 게시물의 오류입니다. 서버를 다시 시작하여 문제를 해결할 수 있습니다. 어쨌든 고맙습니다. – user3444828

0

, 그것은 작동합니다. 정책을 추가 한 후 정책이 올바르게 추가되었는지 확인하십시오. 예. 정책에서 불필요한 공백을 제거하십시오.

올바르게 PDP에 게시하고 시도하십시오. IS 5.3.0의 정책 창에서 "시도"옵션을 사용해 볼 수도 있습니다. JSON에서 작동하지 않기 때문에 xml 요청 만 사용하십시오.