Hi,
I want to create custom authentication for BI Server-5.1, but have some problems.
I created the jar with my implementation of UserDetailsService and IUserRoleListService, put it to the /tomcat/webapps/pentaho/WEB-INF/lib. After I put applicationContext-pentaho-security-custom.xml and applicationContext-spring-security-custom.xml to /pentaho-solutions/system. I had edit the pentaho-spring-beans.xml and it looks like this then:
And i changed the provider to custom in security.properties.
When I run Pentaho and try to open it in browser it produce error. In logs I have exception:
Then I tried to use in-box memory security context with
and had same exception.
What steps I missed?
Thanks.
I want to create custom authentication for BI Server-5.1, but have some problems.
I created the jar with my implementation of UserDetailsService and IUserRoleListService, put it to the /tomcat/webapps/pentaho/WEB-INF/lib. After I put applicationContext-pentaho-security-custom.xml and applicationContext-spring-security-custom.xml to /pentaho-solutions/system. I had edit the pentaho-spring-beans.xml and it looks like this then:
Code:
<!-- omitted -->
<import resource="pentahoSystemConfig.xml" />
<import resource="adminPlugins.xml" />
<import resource="systemListeners.xml" />
<import resource="repository.spring.xml" />
<import resource="applicationContext-spring-security.xml" />
<import resource="applicationContext-common-authorization.xml" />
<import resource="applicationContext-spring-security-custom.xml" />
<import resource="applicationContext-pentaho-security-custom.xml" />
<import resource="defaultUser.spring.xml" />
<import resource="olap4j.spring.xml" />
<import resource="pentahoObjects.spring.xml" />
<import resource="sessionStartupActions.xml" />
<!-- omitted -->
When I run Pentaho and try to open it in browser it produce error. In logs I have exception:
Code:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'repositoryFileDao' defined in file [/home/user/Pentaho/biserver-ce/pentaho-solutions/system/repository.spring.xml]: Cannot resolve reference to bean 'jcrTemplate' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jcrTemplate' defined in file [/home/user/Pentaho/biserver-ce/pentaho-solutions/system/repository.spring.xml]: Cannot resolve reference to bean 'jcrSessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jcrSessionFactory' defined in file [/home/user/Pentaho/biserver-ce/pentaho-solutions/system/repository.spring.xml]: Invocation of init method failed; nested exception is javax.jcr.LoginException: LoginModule ignored Credentials
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:495)
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:162)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:925)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:835)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 73 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jcrTemplate' defined in file [/home/user/Pentaho/biserver-ce/pentaho-solutions/system/repository.spring.xml]: Cannot resolve reference to bean 'jcrSessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jcrSessionFactory' defined in file [/home/user/Pentaho/biserver-ce/pentaho-solutions/system/repository.spring.xml]: Invocation of init method failed; nested exception is javax.jcr.LoginException: LoginModule ignored Credentials
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 88 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jcrSessionFactory' defined in file [/home/user/Pentaho/biserver-ce/pentaho-solutions/system/repository.spring.xml]: Invocation of init method failed; nested exception is javax.jcr.LoginException: LoginModule ignored Credentials
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
... 101 more
Caused by: javax.jcr.LoginException: LoginModule ignored Credentials
at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1493)
at org.pentaho.platform.repository2.unified.jcr.sejcr.CredentialsStrategySessionFactory.getAdminSession(CredentialsStrategySessionFactory.java:343)
at org.pentaho.platform.repository2.unified.jcr.sejcr.CredentialsStrategySessionFactory.registerNamespaces(CredentialsStrategySessionFactory.java:246)
at org.pentaho.platform.repository2.unified.jcr.sejcr.CredentialsStrategySessionFactory.afterPropertiesSet(CredentialsStrategySessionFactory.java:176)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1369)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1335)
... 111 more
Caused by: javax.security.auth.login.FailedLoginException: LoginModule ignored Credentials
at org.apache.jackrabbit.core.security.authentication.LocalAuthContext.login(LocalAuthContext.java:87)
at org.apache.jackrabbit.core.RepositoryImpl.login(RepositoryImpl.java:1465)
... 116 more
Code:
<!-- omitted -->
<import resource="pentahoSystemConfig.xml" />
<import resource="adminPlugins.xml" />
<import resource="systemListeners.xml" />
<import resource="repository.spring.xml" />
<import resource="applicationContext-spring-security.xml" />
<import resource="applicationContext-common-authorization.xml" />
<import resource="applicationContext-spring-security-memory.xml" />
<import resource="applicationContext-pentaho-security-memory.xml" />
<import resource="defaultUser.spring.xml" />
<import resource="olap4j.spring.xml" />
<import resource="pentahoObjects.spring.xml" />
<import resource="sessionStartupActions.xml" />
<!-- omitted -->
What steps I missed?
Thanks.