Jump to content
JasperReports 7.0 is now available ×
  • This documentation is an older version of JasperReports Server Visualize.js Guide. View the latest documentation.

    The initialization of the script sets the authentication method and credentials that you want to use for accessing JasperReports Server. You can then use the login and logout functions to manage multiple user sessions.

    This chapter contains the following sections:

    Authentication Properties
    Login With Plain Text Credentials
    Login With SSO Token
    Logging Out
    Login With Hooks
    UI for Login/Logout
    UI for Login/Logout With SSO Token
    Sharing Credentials Between Calls

    Authentication Properties

    The properties argument to the visualize function has all the fields for specifying various authentication methods.

    There are several ways to set the user credentials, based on your environment.

     

    Login With Plain Text Credentials

    Specify the username, password, organization if required, and optional parameters in the authstructure.

    Login With SSO Token

    If you have a single-sign-on (SSO) provider implemented and have configured JasperReports Server to use it, you can specify the SSO token for Visualize.js login. This example shows a token from a Central Authentication Service (CAS) server.

    Some SSO mechanisms require encoding, or additional parameters, or both. For example, if your server is configured for pre-authentication, you could use the following example to authenticate from Visualize.js. Note that the encoded fields depend on the specifics of your pre-authentication configuration:

    Logging Out

    To log out and destroy the current user session, call the logout function and optionally specify any action to take when done.

    Login With Hooks

    If you have external authentication providers, you can invoke their login and logout URLs.

    UI for Login/Logout

    You can define IDs (#name) with listeners that perform login and logout functions. In your HTML, you can then assign these IDs to the appropriate buttons or links.

    UI for Login/Logout With SSO Token

    The code is slightly different if you have a login/logout UI and use SSO tokens. Note that the logout uses the .always event instead of .done.

    Sharing Credentials Between Calls

    Use the visualize.config function to define and store authentication credentials. It uses the same auth structure as the visualize function. You can then create several containers with separate calls to visualize, but using the common credentials.


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...