Hitachi Vantara Pentaho Community Forums
Results 1 to 2 of 2

Thread: Accessing getSolutionRepositoryDoc Webservice using Spring Security with preAuthFilte

  1. #1
    Join Date
    Apr 2013
    Posts
    11

    Default Accessing getSolutionRepositoryDoc Webservice using Spring Security with preAuthFilte

    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

  2. #2

    Default

    I have the same problem, i'm using Pentaho CE 6.2, i tried to copy past his configuration into my applicationContext-spring-security.xml file but it doesn't work, i tried also to use JavaEeFiler, j2eePreAuthFitler and always the same problem any ideas how to configure spring security with preauthentification filter ?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.