Coder Social home page Coder Social logo

bypasspentahologin's Introduction

byPassPentahoLogin

Bypass Pentaho Login is a tool to can access to some pentaho resources, such as reports or dashboards, from a third party tool.

The idea behind is to create a token codified in the same way in the Pentaho server and in the third party tool that allow the login

#Usage

###place in WEB-INF/classes the properties file destinos.properties

This properties file looks like this:

  userid=admin
  password=password
  destination_1=/pentaho/api/repos/%3Apublic%3ASteel Wheels%3ADashboards%3ACTools_dashboard.wcdf/generatedContent
  destination_2=/pentaho/api/repos/%3Apublic%3ASteel Wheels%3ADashboards%3ACTools_dashboard.wcdf/generatedContent

This properties file have: -The user credentials we will use to bypass the login. It is recommended NOT to use the admin user for this. -The route of all the destinations available... you can add as much as you want.

###Put the jar byPassPentahoLogin.jar in the pentaho/WEB-INF/lib directory

###Declare the filter and the servlet in the Pentaho web.xml

You should add the filter before Spring Security Filter Chain Proxy

	<filter>
		<filter-name>JortillesCultomFilter</filter-name>
		<filter-class>com.jortilles.pentaho.util.JortillesCultomFilter</filter-class>
	</filter>

And the filter mapping also before Spring Security Filter Chain Proxy ...

    <filter-mapping>
	   <filter-name>JortillesCultomFilter</filter-name>
	   <url-pattern>/Urbano</url-pattern>
	</filter-mapping>

Add the servelt just at the end of the servlet declarations.

  <!-- insert additional servlets -->
  <servlet>
    <servlet-name>Urbano</servlet-name>
    <servlet-class>com.jortilles.pentaho.util.Urbano</servlet-class>
  </servlet>
  
   <servlet-mapping>
    <servlet-name>Urbano</servlet-name>
    <url-pattern>/Urbano</url-pattern>
  </servlet-mapping>

###Finally... if you are using pentaho 5.3 or above you should enable the option to accept user and password form the url. in /pentaho-solutions/system/security.properties you should set to true the parameter requestParameterAuthenticationEnabled

  requestParameterAuthenticationEnabled=true

Take a look at:

https://help.pentaho.com/Documentation/5.3/0P0/000/090

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

###Now you are able to bypass the login by calling:

http://localhost:8080/pentaho/Urbano?token=e99b5cdc07594f1e7bed336bbaf2e2db&dst=destination_1

Where: The destination_1 is the destination you declared in the destinos.properties file.

The token is the md5 hash of the string: date + "SomeExtraText" + destination where:

  • The date is the date with the format dd-MM-yyyy
  • "SomeExtraText" is just some extra text to make the hash ugliest. You can modify the class JortillesCultomFilter and place here you desired text
  • Destination is the destination you want to go... in this example destination_1

The filter will decode the call and attach the user and password defined in the properties file to the redirection call. As well all the rest of the parameters.

So... now you only have to codify your hash in the same way in the third party tool. And make your call to:

http://localhost:8080/pentaho/Urbano?token=e99b5cdc07594f1e7bed336bbaf2e2db&dst=destination_1

bypasspentahologin's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.