Problem :
How to redirect to the custom page with custom authentication once the session is timed out?
Default Behaviour :
By default, Jasperserver redirects users to the home/login page once the session ends.
Resolution :
We can redirect users to a custom page. For this we need to add the bean "proxyExceptionTranslationFilter" in the applicationContext-externalAuth-<authType>.xml file under the WEB-INF folder: There we have to pass the url as a constructor parameter for bean "com.jaspersoft.jasperserver.api.security.externalAuth.wrappers.spring.JSLoginUrlAuthenticationEntryPoint". A sample for the same is given below:
<bean id="proxyExceptionTranslationFilter" class="com.jaspersoft.jasperserver.api.security.externalAuth.wrappers.spring.JSExceptionTranslationFilter"> <constructor-arg index="0"> <bean class="com.jaspersoft.jasperserver.api.security.externalAuth.wrappers.spring.JSLoginUrlAuthenticationEntryPoint"> <constructor-arg index="0"> <value>/externallogin.html</value> </constructor-arg> <property name="forceHttps"> <value>false</value> </property> </bean> </constructor-arg> <property name="accessDeniedHandler"> <bean class="com.jaspersoft.jasperserver.war.JRSAccessDeniedHandlerImpl"> <property name="errorPage" value="/WEB-INF/jsp/modules/system/AccessDeniedPage.jsp"/> <property name="themeResolver" ref="themeResolver" /> <property name="themeSource" ref="themeSource" /> <property name="localeResolver" ref="filterLocaleResolver"/> </bean> </property> </bean>
Now save the applicationContext-externalAuth-<authType>.xml file and restart the server.
Recommended Comments
There are no comments to display.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now