2014-07-23 3 views
0

WS02 Identity Server가 우리 회사의 응용 프로그램에 대한 인증 된 권한 제어를 담당하는 회사에서 배포하기에 적합한 기술인지 조사하고 있습니다.WSO2 Identity Server EntitlementService API 파이썬 예제?

우리는 파이썬으로 우리의 애플 리케이션의 대부분을 작성하고 지금까지 내가 WS02is의 EntitlementService API를 쿼리하는 방법을 찾았습니다 모든 예제는 자바로 작성된 것입니다 보내지 않은 원시 데이터에서 추상 여러 자바 라이브러리 서버. 지금까지 파이썬 코드에서 작동하는 예제로 리버스 엔지니어링을하지 않았습니다.

누구나 파이썬으로 작성된 코드의 예가 있습니까? 또는 컬을 통해 요청을 보내는 것과 같이 다른 방식으로 쓰여진 다른 최소한의 접근법/언어는 전송해야 할 것을 정확하게 이해하는 데 큰 도움이 될 것입니다.

은 내가 데이터 나는 또한 내가의 수정입니다

<faultstring>namespace mismatch require http://org.apache.axis2/xsd found urn:oasis:names:tc:xacml:3.0:core:schema:wd-17</faultstring> 

같은 응답 지금까지 결과를 보낸 모든 쿼리 이후 요청에 enscapsulated하도록되어 방법에 대한 기본적인 오해를 가지고 있다고 생각 WS02 신원 확인 서버의 현재 버전이 SOAP뿐만 아니라 REST에서 EntitlementService API를 공개한다는 것을 이해하고 있습니까? (나는 REST와 SOAP 형식의 요청을 모두 시도해 왔지만, REST가 실제로 유효한지, 아니면이 API에 대해서는 100 %가 아니라는 것을 발견했다.)

답변

0

AFAIK WSO2 IS 5.0.0에는 XACML 용 REST 인터페이스가 없지만 지금부터는 멀지 않은 미래의 릴리스에서 계획됩니다. 현재 SOAP 및 THRIFT 인터페이스 만 있습니다.

curl을 통해 다음과 같이 요청 해보십시오. < 요청 부분은 >입니다. </요청 >은 XACML이고 나머지는 WSO2 특정 SOAP입니다.

<?xml version='1.0' encoding='UTF-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> 
<S:Body> 
<ns2:getDecision xmlns="http://dto.entitlement.identity.carbon.wso2.org/xsd" xmlns:ns2="http://org.apache.axis2/xsd" xmlns:ns3="http://entitlement.identity.carbon.wso2.org/xsd"> 
<ns2:request> 
<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: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> 
<Attributes Category="urn:oasis:names:tc:xacml:1.0:subject-category:access-subject"> 
<Attribute AttributeId="http://wso2.org/claims/role" IncludeInResult="false"> 
<AttributeValue DataType="http://www.w3.org/2001/XMLSchema#string">payroll</AttributeValue> 
</Attribute> 
</Attributes> 
<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">ssocircle:permissions:paycheck</AttributeValue> 
</Attribute> 
</Attributes> 
</Request> 
</ns2:getDecision> 
</S:Body> 
</S:Envelope> 
+0

감사합니다. 매우 도움이되었습니다. –

관련 문제