6

I need to integrate my Pentaho Community dashboard report in a DotNet application. Now I am facing a problem. I want the report to open on single click without the Pentaho server asking for authentication or log in. I tried to find out a solution and found that if I use userid and password in the url, it will work. So I did this

http://192.168.2.122:8085/pentaho/api/repos/:home:Time%20Sheet%20Reports:Project%20Effort%20Analysis%20Dashboard.wcdf/generatedContent&userid=admin&password=password

But this is not working for me and the browser is still asking for login credentials. I don't understand what went wrong. Any help with the same will be most appreciated.

Thanks in advance. Regards, Ritesh.

Ritesh
  • 237
  • 1
  • 4
  • 13
  • https://stackoverflow.com/questions/38472931/viewing-pentaho-dashboard-outside-pentaho/44707110#44707110 https://stackoverflow.com/questions/13758578/pentaho-reportviewer-url-not-loading-in-iframe?noredirect=1&lq=1 – David Oct 29 '19 at 03:25

2 Answers2

14

You need the following user to be created under the Manage Users & Roles Perspective:

anonymousUser (notice the uppercase U)

You can give this user any password; this is only to make sure this user maps the user used in the configuration files inside pentaho-solutions/system

Make sure the Anonymous role has at least the Read Permission.

The Anonymous role should exist already in the BA Server (this is by default a system role in the Manage Users and Roles Perspective)

Under Public create a folder: in my case "OpenReports"

Select the "OpenReports" folder click properties > click Share > Uncheck > Inherits folder permissions

Make sure to add anonymousUser and role anonymous to it and they at least the Read permission

Click OK

Copy an Analyzer report to the new OpenReports folder

Verify the permissions for anonymousUser and Anonymous role were inherited; if not add them accordingly.

Stop BA Server

Locate the following file:

\pentaho\server\biserver-ee\pentaho-solutions\system\applicationContext-spring-security.xml

Add the following lines:

\A/i18n.*\Z=Anonymous,Authenticated

\A/js/utils.js\Z=Anonymous,Authenticated

\A/api/.*require-js-cfg.js\Z=Anonymous,Authenticated

\A/api/.*\Z=Anonymous,Authenticated

\A/api/repos.*\Z=Anonymous,Authenticated

\A/api/common-ui/resources/.*\Z=Anonymous,Authenticated

\A/api/common-ui/util/.*\Z=Anonymous,Authenticated

The following lines open the anonymous access to the OpenReports folder and its contents

\A/api/repos.*public.*openreports.*\Z=Anonymous,Authenticated

\A/api/repos.*public.*openreports.*/viewer/.*\Z=Anonymous,Authenticated

\A/api/repos.*public.*openreports.*/common-ui/.*\Z=Anonymous,Authenticated

\A/api/repos.*public.*openreports.*/common-ui/util/.*\Z=Anonymous,Authenticated



after:

\A/js/require-cfg.js\Z=Anonymous,Authenticated

and before:

\A/content/data-access/resources/gwt/.*css\Z=Anonymous,Authenticated

Add the following lines: (these open the URL access to the Analyzer plugin)

\A/content/pentaho-cdf/.*\Z=Anonymous,Authenticated

\A/content/common-ui/.*\Z=Anonymous,Authenticated

\A/content/analyzer/.*\Z=Anonymous,Authenticated

\A/content/analyzer/scripts/.*\Z=Anonymous,Authenticated 

Make sure to add these lines:

After:

\A/content/data-access/resources/gwt/.*css\Z=Anonymous,Authenticated

and before:

\A/webcontext.js.*\Z=Anonymous,Authenticated

Locate the following

Change the following lines from:

\A/api/.*\Z=Authenticated

\A/plugin/.*\Z=Authenticated

to:

\A/api/.*\Z=Anonymous,Authenticated

\A/plugin/.*\Z=Anonymous,Authenticated

Save the file

Restart your BA Server

You should be able to successfully call the report by URL without having to authenticate through the login page; here is a sample URL:

http://192.168.2.122:8085/pentaho/api/repos/:public:OpenReports:Leading%20Product%20Lines%20(pivot%20table).xanalyzer/editor

Marlon Abeykoon
  • 11,927
  • 4
  • 54
  • 75
  • 1
    Thank You Marlon.. It works.. Its just what I wanted. Not giving away the whole server. It just makes one folder anonymous. Thank you again. – Ritesh Feb 10 '15 at 06:33
  • Marlon, I cant understand your "after", "before", "to". Please could you tell us the exactly tag or line to modify in applicationContext-spring-security.xml file. Something like : https://help.pentaho.com/Documentation/5.3/0P0/150/040. Thanks in advance!! – JRichardsz Jun 07 '16 at 20:29
  • @JRichardsz "before" is the line you need to search for and "after" is the line you have to copy paste on the searched line (replace). Hope you got it. – Marlon Abeykoon Jun 08 '16 at 04:50
  • Anyone know if this is possible in 8.0 or so? It seems there's no way to get access to files in the jackrabbit repository if you're not an authenticated user, so the only solution is to create some sort of dummy guest user? – Codek Nov 07 '18 at 15:35
  • 1
    @Codek Haven't used Pentaho for 3 years now. You better ask a new question referring this answer, Hope someone will answer. – Marlon Abeykoon Nov 08 '18 at 05:57
3

Here the simplest way to bypass the log in :

http://pedroalves-bi.blogspot.pt/2015/02/useful-tips-easy-authentication-in.html

it's work for me, i'm using pentaho 5.4

don't forget to create anonymousUser and in "system Roles" check only "Read Content".

if you use admin user and then you try to access http://localhost:8080/pentaho/Home it will automaticly login because the browser still have session login.

sorry for my bad english,

syarif
  • 67
  • 3