Loginpage doesn't load after implementing Cipher

I am trying to implement TokenBasedAuth and have implemented Cipher. I've copied my jar to  <js-install>\apache-tomcat\webapps\jasperserver\WEB-INF\lib

and my applicationContext-externalAuth-preAuth.xml file to  <js-install>\apache-tomcat\webapps\jasperserver\WEB-INF. 
 

..
    <property name="tokenDecryptor">
        <!-- <bean class="com.jaspersoft.jasperserver.api.common.crypto.PlainTextNonCipher"/> -->
        <bean class="com.jaspersoft.cipher.myCipher"/>
    </property>
..

This is my bean implementation. the correct package name reference to class is given. But, when goto http://localhost:8080/jasperserver/login.html, it produces

HTTP Status 404 – Not Found error even after restarting the server. Any suggestions, please? thanks

I am having the following implementation in applicationContext-externalAuth-preAuth.xml

..
<bean id="proxyPreAuthenticatedProcessingFilter" class="com.jaspersoft.jasperserver.api.security.externalAuth.preauth.BasePreAuthenticatedProcessingFilter">
    <!-- request parameter containing pre-authenticated token with user info -->
    <property name="principalParameter" value="pp"/>
    <!-- tokenInRequestParam=false - principalParameter is read from header only.
         tokenInRequestParam=true  - principalParameter is read from request url parameters only.
                                     If tokenInRequestParam is not specified, the authentication token is looked up in request header
                                     and, then, if not found, in request params -->
    <property name="tokenInRequestParam" value="true"/>
    <!-- Check if there's a new token in the request -->
    <property name="checkForPrincipalChanges" value="true"/>
    <!-- DevelopmentPlainTextNonCipher works with the plain-text tokens by default. It should be used in the development phase only.-->
    <!-- In prod., substitute with your token decryption implementation of com.jaspersoft.jasperserver.api.common.crypto.CipherI interface -->
 
    <property name="tokenDecryptor"             ><bean class="com.mycipher.MyCipher"  /></property>
    <property name="externalDataSynchronizer"   ><ref  bean="externalDataSynchronizer"/></property>
    <property name="authenticationManager"      ><ref  bean="preAuthenticatedManager" /></property>
    <property name="authenticationDetailsSource">
        <bean class="com.jaspersoft.jasperserver.api.security.externalAuth.preauth.BasePreAuthenticatedGrantesAuthorityDetailsSource"/>
    </property>
    <property name="jsonRedirectUrl" ref="authSuccessJsonRedirectUrl"/>
</bean>
..-

The error thrown in logs is as follows

>25-Jan-2020 07:26:25.280 SEVERE [localhost-startStop-2] 
 org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [com.jaspersoft.jasperserver.war.util.SpringBeanServletContextPlublisher]
 org.springframework.beans.factory.BeanCreationException:
    Error creating bean with name 'proxyPreAuthenticatedProcessingFilter' defined in ServletContext resource [/WEB-INF/applicationContext-externalAuth-preAuth.xml]:
        Cannot resolve reference to bean 'preAuthenticatedManager' while setting bean property 'authenticationManager';
                nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'preAuthenticatedManager' 
                defined in ServletContext resource [/WEB-INF/applicationContext-externalAuth-preAuth.xml]:
        Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException:
            Invalid property 'providers' of bean class [com.jaspersoft.jasperserver.api.security.externalAuth.wrappers.spring.JSProviderManager]:
                Bean property 'providers' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:359)
    at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1534)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1281)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:551)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:481)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:312)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
    at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:308)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
    at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
    at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:443)
    at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:325)
    at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:107)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4792)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5256)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:754)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:730)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734)
    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1140)
    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1875)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'preAuthenticatedManager' defined in ServletContext resource 
[/WEB-INF/applicationContext-externalAuth-preAuth.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: 
Invalid property 'providers' of bean class [com.jaspersoft.jasperserver.api.security.externalAuth.wrappers.spring.JSProviderManager]: 
Bean property 'providers' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?

jamshaidiqbal120's picture
Joined: Nov 25 2019 - 11:04am
Last seen: 7 months 3 weeks ago

0 Answers:

No answers yet
Feedback