Skip to content
View in the app

A better way to browse. Learn more.

Jaspersoft Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
This documentation is an older version of JasperReports Server Web Services Guide. View the latest documentation.

When making a login request, the user ID and password can be pass as URL arguments or as content in the request body:

Method

URL

POST

GET

http://<host>:<port>/jasperserver[-pro]/rest/login/

http://<host>:<port>/jasperserver[-pro]/rest/login?<arguments>

Argument

Type/Value

Description

j_username

Text

The user ID. In commercial editions of the server that implement multiple organizations, the argument must specify the organization ID or alias in the following format: j_username%7Corganization_id (%7C is the | character).

j_password?

Text

The user’s password. If the server has login encryption enabled, the password must be encrypted as explained in section the figure “Login Encryption”. The argument is optional but authentication will fail without the password.

Content-Type

Content

application/x-www-form-urlencoded

j_username=<userID>[%7C<organization_id>]&j_password=<password>

Example: j_username=jasperadmin&j_password=jasperadmin

or j_username=jasperadmin%7Corganization_1&j_password=jasperadmin

Return Value on Success

Typical Return Values on Failure

200 OK – Session ID in cookie (POST only), empty body.

401 Unauthorized – Empty body.

302 – License expired or otherwise not valid.

The login service has several uses:

POST method – Applications should use the POST method, because it returns the session cookie to use in future requests.
GET method – Developers can test the login service and the user credentials from a browser, which uses the GET method.
Credentials in arguments – When testing the login service in a browser, credentials are passed as arguments in the URL:

http://<host>:<port>/jasperserver[-pro]/rest/login?j_username=<userID>[%7C<organization_id>]

&j_password=<password>

Credentials in content – When using the POST method, credentials can either be sent in the URL arguments as shown above, or sent in the content of the request, as shown in the second example below.

The following example shows the HTTP request and response when testing the login service in a browser. In this case, the user credentials are passed as arguments and the browser sends a GET request. Because the GET request is meant only for testing, it does not return a cookie with the session ID.

The following example shows the content of a POST request where the credentials are passed in the content.

For optimal performance, the session ID from the cookie should be used to keep the session open. To do this, include the cookie in future requests to the other RESTful services. For example, given the response to the POST request above, future requests to the repository services should include the following line in the header:

Cookie: $Version=0; JSESSIONID=52E79BCEE51381DF32637EC69AD698AE; $Path=/jasperserver

However, maintaining a session with cookies is not mandatory, and your application can use any combination of session cookie, HTTP Basic Authentication, or both.

User Feedback

Recommended Comments

There are no comments to display.



Guest
This is now closed for further comments

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.