Anonymous access on a report folder

 Hello,

I am a newbie to JasperServer and am using the JasperServer Community version 3.7.0.

I am trying to setup Anonymous access on a report folder (no login required).

I tried using the following threads:

 

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=71124

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=48284

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=50689

 

Right now all I get is a blank screen, I can not login or even view a report.

Any ideas?

 

Thanks in advance

 

 

 

 

nasa's picture
310
Joined: Feb 2 2010 - 6:45am
Last seen: 4 months 2 weeks ago

17 Answers:

nasa,

You'll need to provide more details in order for anyone to help. The second thread you mention is one I responded to. It solved the problem for that user. The third thread is really a repeat of the second one. And it worked as well.

It's tough to guess what you have already done when you write, "all I get is a blank screen". Maybe you need to open a browser. Or plug in your monitor. OK, I'm kidding. ;-)  I'm sure you've done some reasonable first steps... but you have not described them.

Regards,
Matt

mdahlman's picture
37526
Joined: Mar 13 2007 - 2:43am
Last seen: 8 years 10 months ago

Hi Matt,

Funny post I must admit.

I tried each thread seperately and no solution seemed to work with version 3.7.

I will document my steps below?

 

First Attempt:

Edited the file applicationContext-security.xml

<bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
    <property name="key"><value>foobar</value></property>
    <property name="userAttribute"><value>anonymousUser,ROLE_ADMINISTRATOR</value></property>
</bean>

Restarted JasperServer, tried to run report, brought me to login screen

Second Attempt:

Edited the file applicationContext-security.xml and followed the steps outlined in http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=50689

Restarted JasperServer, tried to run report, got a blank screen

Third Attempt

Did everything as outlined in Second Attempt and edited the file WEB-INF/applicationContext-events-lgging.xml

 <bean id="accessContext"
          class="com.jaspersoft.jasperserver.api.logging.access.context.impl.AccessContextImpl">
        <property name="clientClassFactory" ref="mappingResourceFactory"/>
        <property name="loggingContextProvider" ref="${bean.loggingContextProvider}"/>
        <property name="userAuthorityService" ref="${bean.userAuthorityService}"/>
    </bean>

Restarted JasperServer, tried to run report, got a blank screen

That is what I have done.

I also, tried the following:

I installed version 3.5, followed steps outlined in http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=50689; everything works.

Why doesn't the same solution work for 3.7?

Thanks



Post Edited by nasa at 03/04/2010 17:39



Post Edited by nasa at 03/04/2010 20:39
nasa's picture
310
Joined: Feb 2 2010 - 6:45am
Last seen: 4 months 2 weeks ago

Has anybody enabled Anonymous access, run a report without logging in, in JasperServer 3.7

nasa's picture
310
Joined: Feb 2 2010 - 6:45am
Last seen: 4 months 2 weeks ago

Hello,

I finally got Anonymous access working for a simple report, but when I select a report with parameters; I get the attached error.

Has anybody come across this?

 

2010-03-06 01:08:35,586  WARN DefaultRemoter,http-80-Processor21:67 - Method execution failed:
java.lang.NullPointerException
    at com.jaspersoft.jasperserver.war.cascade.CascadeDirector.initialize(CascadeDirector.java:40)
    at com.jaspersoft.jasperserver.war.cascade.CascadeDirector$$FastClassByCGLIB$$cb78188c.invoke(<generated>)
    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)
    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:700)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
    at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
    at com.jaspersoft.jasperserver.war.cascade.CascadeDirector$$EnhancerByCGLIB$$c50d9985.initialize(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.directwebremoting.impl.ExecuteAjaxFilter.doFilter(ExecuteAjaxFilter.java:34)
    at org.directwebremoting.impl.DefaultRemoter$1.doFilter(DefaultRemoter.java:428)
    at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:431)
    at org.directwebremoting.impl.DefaultRemoter.execute(DefaultRemoter.java:283)
    at org.directwebremoting.servlet.PlainCallHandler.handle(PlainCallHandler.java:52)
    at org.directwebremoting.servlet.UrlProcessor.handle(UrlProcessor.java:101)
    at org.directwebremoting.spring.DwrSpringServlet.doPost(DwrSpringServlet.java:158)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at com.jaspersoft.jasperserver.war.common.UploadMultipartFilter.doFilter(UploadMultipartFilter.java:83)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378)
    at com.jaspersoft.jasperserver.war.security.JSSwitchUserProcessingFilter.doFilterHttp(JSSwitchUserProcessingFilter.java:146)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
    at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.providers.anonymous.AnonymousProcessingFilter.doFilterHttp(AnonymousProcessingFilter.java:105)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at com.jaspersoft.jasperserver.api.metadata.user.service.impl.MetadataAuthenticationProcessingFilter.doFilter(MetadataAuthenticationProcessingFilter.java:139)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at com.jaspersoft.jasperserver.war.util.RequestParameterAuthenticationFilter.doFilter(RequestParameterAuthenticationFilter.java:97)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at com.jaspersoft.jasperserver.war.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:175)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.ui.AbstractProcessingFilter.doFilterHttp(AbstractProcessingFilter.java:277)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at com.jaspersoft.jasperserver.war.UserPreferencesFilter.doFilter(UserPreferencesFilter.java:175)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at com.jaspersoft.jasperserver.api.logging.filter.BasicLoggingFilter.doFilter(BasicLoggingFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235)
    at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53)
    at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390)
    at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175)
    at org.springframework.security.util.FilterToBeanProxy.doFilter(FilterToBeanProxy.java:99)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at com.jaspersoft.jasperserver.war.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:67)
    at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236)
    at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
    at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
    at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
    at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
    at java.lang.Thread.run(Thread.java:595)
2010-03-06 01:08:35,616  WARN BaseCallMarshaller,http-80-Processor18:59 - --Erroring: batchId[0] message[java.lang.NullPointerException]
2010-03-06 01:08:35,626  WARN BaseCallMarshaller,http-80-Processor21:59 - --Erroring: batchId[0] message[java.lang.NullPointerException]
 

Thanks

 

 

 



Post Edited by nasa at 03/06/2010 05:55
nasa's picture
310
Joined: Feb 2 2010 - 6:45am
Last seen: 4 months 2 weeks ago
How did you get to work anonymous access?
acidcube's picture
564
Joined: Apr 5 2010 - 11:12am
Last seen: 13 years 5 months ago
Hello acidcube,

I never got this to work.
nasa's picture
310
Joined: Feb 2 2010 - 6:45am
Last seen: 4 months 2 weeks ago
yeah, I just kept getting a blank screen when I entered the login screen as you described...I wonder if anyone knows the right steps to do this
acidcube's picture
564
Joined: Apr 5 2010 - 11:12am
Last seen: 13 years 5 months ago

I am also facing the same issue with JS 3.7 CE. Was anyone able to implement it successfully.

sup03's picture
246
Joined: Jan 10 2010 - 11:30pm
Last seen: 13 years 8 months ago

After implenting the changes, i get the same blank page.

When I look at the log file, it shows the following error message:

010-08-10 14:23:46,982 ERROR JSErrorPage_jsp,http-8080-2:359 -
org.springframework.beans.NotReadablePropertyException: Invalid property 'principal.fullName' of bean class [org.springframework.security.providers.anonymous.AnonymousAuthenticationToken]: Bean property 'principal.fullName' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
    at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:540)
    at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:532)
...

 

If  you do a search for principal.fullName, it comes up with two files.  decorator.jsp and header.jsp.

 

I'm guessing its trying to fetch the fullName when there is nothing to fetch because we are anonymously logging in.  So it will crash and you will get a blank page.

 

So if we look at header.jps, we see where its trying to get(? i guess) the fullName.

 <authz:authorize ifNotGranted="ROLE_ANONYMOUS">
                    <p id="userIdentification">
                        <c:if test="<%= com.jaspersoft.jasperserver.api.metadata.user.service.impl.UserAuthorityServiceImpl.isUserSwitched() %>">
                            <span id="casted">
                            <%= ((com.jaspersoft.jasperserver.api.metadata.user.domain.User)com.jaspersoft.jasperserver.api.metadata.user.service.impl.UserAuthorityServiceImpl.getSourceAuthentication().getPrincipal()).getFullName() %>
                            <spring:message code="jsp.main.as"/>
                            </span>
                        </c:if>
                        <authz:authentication property="principal.fullName"/>
                    </p>
                    </authz:authorize>

 

Correct me if i'm wrong, but It shouldn't go into that block unless we had other ROLES besides ROLE_ANONYMOUS when going directly to the report.

If we were to comment out the line <authz:authentication property="principal.FullName"> in both jsp files, then the blank page should have something.  But of course, then you won't see the user's name when they do actually login.

But I am unsure what modifications to make so that we can login and still display the user's fullName.  Any suggestions?

pwpwpw's picture
147
Joined: Nov 18 2009 - 11:49am
Last seen: 4 years 1 month ago

You really should read other posts, even ones who's subjects are in no way related to what you want.

See how to get anon access to reports working with JS 3.7 CE in my post:

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=609&page=2#77631

Let me know how it goes for you.

LasiniR 

lasinir's picture
58
Joined: Aug 23 2009 - 5:51pm
Last seen: 14 years 1 month ago

The fix is listed in another post, a simple change to the applicationContext-events-logging.xml file (if you have already made changes to the applicationContext-security.xml file as suggested earlier in this post).

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=71124

As an aside, I was able to allow anonymousUser access to run reports through a direct URL by simply adding the userAuthorityService property to the applicationContext-events-logging.xml accessContext bean, giving read privileges on the root folder and only adding ROLE_ANONYMOUS (line 735) to the flowVoter bean in applicationContext-security.xml.  No changes were needed to the anonymousProcessingFilter bean (lines 88-91) or the filterInvocationInterceptor bean (lines 337-364) in applicationContext-security.xml to get this to work with jasperserver 3.7.1.

gustafsf's picture
235
Joined: Nov 18 2008 - 2:24pm
Last seen: 4 years 4 months ago

This worked for me on 4.5

adam704a - 10 years 4 months ago

What I need change in jasperserver 4.0.1? This solution for 3.7 is not working in 4.1.0



Post Edited by lordhades at 09/15/2011 13:43
lordhades's picture
Joined: Sep 15 2011 - 1:57am
Last seen: 12 years 2 weeks ago

i didnt go throug all the thread in this but, below post might help you..i followed the steps given in the post.

http://jasperforge.org/plugins/espforum/view.php?group_id=112&forumid=102&topicid=609&page=2

i was able to access reports without log in to the server

i am using jasper sever 4.0



Post Edited by rajasekharpbsi at 09/16/2011 05:36
rajasekharpbsi's picture
Joined: Aug 25 2011 - 2:59am
Last seen: 12 years 1 month ago

So far, everything that I have tried for version 4 doesn't seem to work.

If anybody can document the steps to get this to work on JasperServer 4 would be greatly appreciated.

 

 

nasa's picture
310
Joined: Feb 2 2010 - 6:45am
Last seen: 4 months 2 weeks ago

The problem maybe is that in v4.1 there isn't a /fileview/ property in flowVoter.

Could sb copy his working flowVoter bean?

My is:

[code]
    <bean id="flowVoter" class="com.jaspersoft.jasperserver.war.security.FlowRoleAccessVoter">
        <property name="flowAccessAttribute" value="FLOW_ACCESS"/>
        <property name="flowDefinitionSource">
            <value>
                repoAdminFlow=ROLE_ADMINISTRATOR
                userListFlow=ROLE_ADMINISTRATOR
                roleListFlow=ROLE_ADMINISTRATOR
                <!--reportUnitFlow=ROLE_ADMINISTRATOR-->
                olapUnitFlow=ROLE_ADMINISTRATOR
                olapClientConnectionFlow=ROLE_ADMINISTRATOR
                mondrianXmlaSourceFlow=ROLE_ADMINISTRATOR
                editFolderFlow=ROLE_ADMINISTRATOR
                fileResourceFlow=ROLE_ADMINISTRATOR
                dataTypeFlow=ROLE_ADMINISTRATOR
                listOfValuesFlow=ROLE_ADMINISTRATOR
                queryFlow=ROLE_ADMINISTRATOR
                reportDataSourceFlow=ROLE_ADMINISTRATOR
                inputControlsFlow=ROLE_ADMINISTRATOR
                <!--objectPermissionToRoleFlow=ROLE_ADMINISTRATOR-->
                userEditFlow=ROLE_ADMINISTRATOR
                roleEditFlow=ROLE_ADMINISTRATOR
                queryReferenceFlow=ROLE_ADMINISTRATOR
                <!--objectPermissionToUserFlow=ROLE_ADMINISTRATOR-->
                searchFlow=ROLE_USER,ROLE_ADMINISTRATOR
                *=ROLE_USER,ROLE_ADMINISTRATOR,ROLE_ANONYMOUS
            </value>
  [/code]

What exacly  *=  means?

I also have logging with ActiveDirectory, but AD accounts and local accounts working fine. Also I have a problem with execute permisson.. It's seems not working for all users. (it's another problem, but solutions appreciated).

 

 

lordhades's picture
Joined: Sep 15 2011 - 1:57am
Last seen: 12 years 2 weeks ago

Hello guys,

I am working on Jasper 4.5.1. I tried some solutions posted in this thread but It didn't help. It keeps throwing the following exception:

org.springframework.beans.NotReadablePropertyException: Invalid property 'principal.fullName' of bean class [org.springframework.security.providers.anonymous.AnonymousAuthenticationToken]: Bean property 'principal.fullName' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
    at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:540)
    at org.springframework.beans.BeanWrapperImpl.getPropertyValue(BeanWrapperImpl.java:532)

Anyone can run Jasper 4.5.1 in anonymous access?

nvthai's picture
35
Joined: Jul 2 2012 - 7:38pm
Last seen: 11 years 2 months ago

You need to update this file: applicationContext-events-logging.xml as mentioned above.

adam704a - 10 years 4 months ago

I have installed Jasper Server 5.6.0 and  made all like in the instruction http://community.jaspersoft.com/wiki/allow-anonymous-access-reports.

Right now all I get is a blank screen with JasperSoft header. I can't press any button.

Firefox Firebug error:

ReferenceError: viewer is not defined
http://localhost:8080/jasperserver/optimized-scripts/report.viewer.page.js
Line 19

ramil.zv's picture
Joined: Jun 4 2014 - 12:20am
Last seen: 7 years 2 months ago
Feedback