authenticationpentahopentaho-cde

Pentaho BI server report without Log in


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.


Solution

  • 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