简体   繁体   English

WSO2 API管理器和XACML集成无法正常工作

[英]WSO2 API Manager and XACML integration not working

I'm trying to integrate the latest version of wso2 API Manager (1.6.0) with the wso2 XACML module . 我正在尝试将最新版本的wso2 API Manager (1.6.0)wso2 XACML module集成在一起。 I've found and followed step by step the very useful article . 我已经找到并逐步进行了非常有用的文章 Unfortunately the PDP refuses the authorize my request even if I remove all my policies from the PAP and publish no policy to the PDP. 不幸的是,即使我从PAP中删除了所有策略,也没有向PDP发布任何策略,PDP仍拒绝了我的请求。

Is their a configuration somewhere I'm missing ? 他们在我想念的地方有配置吗? I'm get the following output 我得到以下输出

[2014-03-05 19:05:37,052] WARN - RequestCtxFactory No Namespace defined in XACML request and Assume as XACML 3.0 [2014-03-05 19:05:37,058] ERROR - EntitlementMediator org.apache.synapse.SynapseException: User is not authorized to perform the action [2014-03-05 19:05:37,059] INFO - LogMediator STATUS = Executing default 'fault' sequence, ERROR_CODE = 0, ERROR_MESSAGE = User is not authorized to perform the action

If there are no policies in the PDP means that PDP would return Not Applicable decision. 如果PDP中没有任何策略,则意味着PDP将返回“ Not Applicable决定。 Therefore PEP of the API manager would think Not Applicable as a deny decision. 因此,API经理的PEP会认为“ Not Applicable是一个拒绝决定。 In XACML there is concept called Deny based PEP What that means, all result except permit are considered as deny. 在XACML中,有一个称为Deny based PEP概念。这意味着,除permit外的所有结果都被视为拒绝。 Therefore to test, you can add some policy with Permit rule and verify. 因此,要进行测试,您可以使用“允许”规则添加一些策略并进行验证。 Such as following 如以下

<Policy xmlns="urn:oasis:names:tc:xacml:3.0:core:schema:wd-17" PolicyId="PermitPolicy" RuleCombiningAlgId="urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable" Version="1.0"> <Target></Target> <Rule Effect="Permit" RuleId="Permit-Rule"></Rule> </Policy>

Also it would be helpful, if you can enable the debug logs in the entitlement component and check.. Because then you can see the XACML request and response messages. 如果您可以在授权组件中启用调试日志并进行检查,也会很有帮助。因为这样您可以看到XACML请求和响应消息。

Add following in to log4j.properties file 将以下内容添加到log4j.properties文件中

log4j.logger.org.wso2.carbon.identity.entitlement=DEBUG

You can check this for more on enabling debug logs 您可以检查此内容以了解更多有关启用调试日志的信息

Once you got the request and response. 获得请求和响应后。 you verify what has gone wrong.. Also you can there is a tryit tool whether you can test the policies. 您可以验证出了什么问题。此外,您还可以使用tryit工具来测试策略。

Thanks very much for your quick and efficient support. 非常感谢您的快速有效的支持。 I've added your "permit" rules and was able to access my backend system after a successful policy validation. 我添加了您的“许可”规则,并在成功验证策略后能够访问我的后端系统。 This means that the loop is closed and that my very simple policy of yesterday was the root of the problem. 这意味着该循环已关闭,而我昨天的非常简单的政策是问题的根源。 I have to review in detail how these rules are setup & defined. 我必须详细审查如何设置和定义这些规则。 Thanks again for your help Regards Vpl 再次感谢您的帮助Regards Vpl

[2014-03-06 19:03:11,637] DEBUG - EntitlementPolicyInvalidationCache My Hash code of Policy cache is : 1 [2014-03-06 19:03:11,637] DEBUG - EntitlementPolicyInvalidationCache Shared Hash code of Policy cache is : 1 [2014-03-06 19:03:11,638] DEBUG - SimplePolicyCollection Matching XACML policy found PermitPolicy [2014-03-06 19:03:11,638] DEBUG - EntitlementBaseCache Cache : $ local $.PDP_DECISION_CACHE is populated with new entry in tena nt domain : carbon.super [2014-03-06 19:03:11,639] DEBUG - EntitlementEngine XACML Response : Permit [2014-03-06 19:03:11,641] DEBUG - EntitlementMediator Entitlement Decision is : Permit [2014-03-06 19:03:11,643] DEBUG - EntitlementMediator User is authorized to perform the action [2014-03-06 19:03:11,644] DEBUG - EntitlementMediator OnAccept sequence is not defined. [2014-03-06 19:03:11,637]调试-EntitlementPolicyInvalidationCache我的策略缓存的哈希码是:1 [2014-03-06 19:03:11,637]调试-EntitlementPolicyInvalidationCache共享策略缓存的哈希码是:1 [2014 -03-06 19:03:11,638]调试-找到与XACML策略匹配的SimplePolicyCollection PermitPolicy [2014-03-06 19:03:11,638]调试-EntitlementBaseCache缓存:$ local $ .PDP_DECISION_CACHE已在tena nt域中填充新条目: carbon.super [2014-03-06 19:03:11,639] DEBUG-EntitlementEngine XACML响应:许可证[2014-03-06 19:03:11,641] DEBUG-EntitlementMediator权利决定是:许可证[2014-03-06 19: 03:11,643]调试-EntitlementMediator用户被授权执行操作[2014-03-06 19:03:11,644]调试-未定义EntitlementMediator OnAccept序列。

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

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