Quantcast
Channel: Pentaho Community Forums - BI Platform
Viewing all articles
Browse latest Browse all 2893

Accessing getSolutionRepositoryDoc Webservice using Spring Security with preAuthFilte

$
0
0
Hi,

I am using Spring Security with a preauthenticationFilter for getting SSO working (Pentaho 4.8).
I can now login to pentaho preauthenticated from my other webapplication.
But my SolutionRepositoryBrowser throws a Nullpointer Exception and i dont know why.

Code:

ERROR [[SolutionRepositoryService]] Servlet.service() for servlet SolutionRepositoryService threw exception
java.lang.NullPointerException
        at org.pentaho.platform.repository.solution.SolutionRepositoryServiceImpl.getSolutionRepositoryDoc(SolutionRepositoryServiceImpl.java:555)


I removed the securityContextHolderAwareRequestFilter from the spring configuration to get the preauth working. if i add the securityContextHolderAwareRequestFilter again, the repositoryservice works (but sso not anymore).


This is my current Spring filter config:
Code:

  <bean id="filterChainProxy" class="org.springframework.security.util.FilterChainProxy">
    <property name="filterInvocationDefinitionSource">
      <!--
          You can safely remove the first pattern starting with /content/dashboards/print, if you're not using
          Enterprise Dashboards or not allowing printing of Dashboards,
      -->
      <value>
        <![CDATA[CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
        PATTERN_TYPE_APACHE_ANT
        /**=httpSessionContextIntegrationFilter,httpSessionReuseDetectionFilter,logoutFilter,j2eePreAuthFilter,authenticationProcessingFilter,basicProcessingFilter,requestParameterProcessingFilter,anonymousProcessingFilter,pentahoSecurityStartupFilter,exceptionTranslationFilter,filterInvocationInterceptor]]>
      </value>
    </property>
  </bean>

and heres my auth config:

Code:

<bean id='j2eePreAuthFilter' class='org.springframework.security.ui.preauth.j2ee.J2eePreAuthenticatedProcessingFilter'>
    <property name='authenticationManager' ref='authenticationManager' />
    <property name='authenticationDetailsSource' ref='authenticationDetailsSource' />
  </bean>
 
  <bean id='preAuthenticatedAuthenticationProvider' class='org.springframework.security.providers.preauth.PreAuthenticatedAuthenticationProvider'>
    <property name='preAuthenticatedUserDetailsService' ref='preAuthenticatedUserDetailsService' />
  </bean>
  <bean id='preAuthenticatedUserDetailsService' class='de.test.MyUserDetailsService' />
   
  <bean id='authenticationDetailsSource' class='org.springframework.security.ui.preauth.j2ee.J2eeBasedPreAuthenticatedWebAuthenticationDetailsSource'>
    <property name='mappableRolesRetriever' ref='j2eeMappableRolesRetriever' />
    <property name='userRoles2GrantedAuthoritiesMapper' ref='j2eeUserRoles2GrantedAuthoritiesMapper' />
  </bean>
 
  <bean id='j2eeUserRoles2GrantedAuthoritiesMapper' class='org.springframework.security.authoritymapping.SimpleAttributes2GrantedAuthoritiesMapper'>
    <property name='convertAttributeToUpperCase' value='false' />
    <property name='attributePrefix' value='' />
  </bean>
 
  <bean id='j2eeMappableRolesRetriever' class='org.springframework.security.ui.preauth.j2ee.WebXmlMappableAttributesRetriever'>
  <property name='webXmlInputStream'>
    <bean factory-bean='webXmlResource' factory-method='getInputStream' />
  </property>
</bean>


 <bean id='webXmlResource' class='org.springframework.web.context.support.ServletContextResource'>
  <constructor-arg ref='servletContext' />
  <constructor-arg value='/WEB-INF/web.xml' />
 </bean>
    <bean id='servletContext' class='org.springframework.web.context.support.ServletContextFactoryBean' />
  <bean id="authenticationManager" class="org.springframework.security.providers.ProviderManager">
    <property name="providers">
      <list>
        <ref bean='preAuthenticatedAuthenticationProvider' />
        <ref bean="daoAuthenticationProvider" />
        <ref local="anonymousAuthenticationProvider" />
      </list>
    </property>




Can anybody help me to get the solutionrepositoy service working with the spring preauthentication configuration?



Thx in advance,
student

Viewing all articles
Browse latest Browse all 2893

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>