【问题标题】:Configuring Custom PIP point in wso2在 wso2 中配置自定义 PIP 点
【发布时间】:2017-11-21 16:31:32
【问题描述】:

如果我缺少更多设置,需要帮助。说明如下

我通过扩展编写了一个自定义 PIP 属性查找器类

AbstractPIPAttributeFinder

wso2 的 XACML 实现。此 PIP 点在内部调用一些服务以返回值。我正在尝试通过执行以下配置在 wso2 中发布,但更改未正确反映在权利服务器的扩展选项卡中。 1. 更新了/CARBON_HOME/repository/conf/identity/entitlement.propeties 中的entitlement.propeties 文件。 2. 将jar放入/CARBON_HOME/repository/components/lib folder

Entitlement.properties 文件设置:

PIP.AttributeDesignators.Designator.1=org.wso2.carbon.identity.entitlement.pip.DefaultAttributeFinder 
PIP.AttributeDesignators.Designator.2=org.wso2.carbon.identity.application.authz.xacml.pip.AuthenticationContextAttributePIP 

PIP.AttributeDesignators.Designator.3=oracle.fsgbu.et.dataAccess.CustomPIPAttributeFinder

oracle.fsgbu.et.dataAccess.CustomPIPAttributeFinder 

是我的类,它解析属性值

【问题讨论】:

  • 问题出在哪里?找不到类?属性没有解析?
  • @gusto2 是 classNotFoundException 主要是。

标签: wso2 xacml


【解决方案1】:

我假设权利引擎无法找到您的课程。您必须让授权库知道您的课程。可以通过OSGi片段来实现

  1. 您必须将包构建为 OSGi 包 - 有多个博客/指南如何做到这一点,例如see this one。你必须使用正确的依赖并导出你的包
  2. 将您的捆绑 jar 放入组件/dropins,而不是库中
  3. 在 pom.xml 中指定 fragment-host 包,它是您自己的实现将被注入的包

org.wso2.carbon.identity.entitlement

这将强制授权引擎知道您的课程

我的 pom.xml 的一部分:

        <plugin>
            <groupId>org.apache.felix</groupId>
            <artifactId>maven-bundle-plugin</artifactId>
            <version>2.3.7</version>
            <extensions>true</extensions>
            <configuration>
                <instructions>
                    <Bundle-SymbolicName>${project.groupId}.${project.artifactId}</Bundle-SymbolicName>
                    <Bundle-Name>${project.build.finalName}</Bundle-Name>
                    <Bundle-Version>${project.version}</Bundle-Version>
                    <Export-Package>
                        com.sample.dp.extpip,
                        com.sample.dp.extpip.conf
                    </Export-Package>
                    <Import-Package>
                        org.wso2.carbon.identity.entitlement.pip;version="0.0.0",
                        org.osgi.framework,
                        javax.xml.parsers;version="0.0.0",
                        *,
                        !javax.activation
                    </Import-Package>
                    <Fragment-Host>org.wso2.carbon.identity.entitlement</Fragment-Host>
                </instructions>
            </configuration>
        </plugin>

【讨论】:

  • 它会自动从lib文件夹转移到dropins文件夹
  • @RishabhGupta nope...它不会转移。从lib,carbon 创建了一个 OSGi 包并导出所有类。缺少的是将您的包导入权利包(创建片段)。
  • @RishabhGupta 开发和部署捆绑包后,您可以使用osgi console 来查看您的捆绑包是否已正确部署、启动和解析为权利捆绑包的片段
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-05-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多