Pentaho更多身份验证提供商

时间:2016-01-28 07:38:44

标签: authentication pentaho provider

我需要开发两个能够处理2个主要用例的自定义身份验证提供程序:

  • 通过用户名和密码表单身份验证登录

  • 通过令牌进行身份验证

我开发了CustomFormAuthProvider和CustomTokenAuthProvider。

在Pentaho appContext-spring-security.xml中我已经使用

声明了两个提供者bean
providername=custom 

因此我将相应的属性(在security.properties中)设置为“custom”。

当我启动pentaho时,我可以看到AccessManager对象只加载了两个提供者......所以当我使用两种身份验证方法之一时会捕获错误。

有没有办法在提供者列表中加载两个提供者,访问管理器可以加载支持当前令牌类型的正确提供者的方式?

由于

1 个答案:

答案 0 :(得分:0)

这可能是答案

https://help.pentaho.com/Documentation/5.4/0P0/150/010/080

编辑

applicationcontext-spring-securit.xml

可以在ProviderManager提供程序列表中添加更多提供程序,如下面的代码

 <bean id="authenticationManager"class="org.springframework.security.providers.ProviderManager">
<property name="providers">
    <list>
        <pen:bean class="org.springframework.security.providers.AuthenticationProvider">
                <pen:attributes>
                    <pen:attr key="providerName" value="jackrabbit"/> 
                </pen:attributes></pen:bean>
        <pen:bean class="org.springframework.security.providers.AuthenticationProvider">     
                 <pen:attributes> 
                    <pen:attr key="providerName" value="webservice"/>
                  </pen:attributes>
        </pen:bean>
        <ref local="anonymousAuthenticationProvider" />
    </list>
    </property> 
</bean>

我会尝试