keep-safe
Web icon

Keep Safe

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 11 January 2022
 by 
0.0
 (0 ratings)
keep-safe

Keep Safe

Documentation
1.0.0

Keep Safe

Installation and Usage Manual

Keep Safe is a component that allows you to securely hide the input parameter of a page or action. It also allows you to implement a way to validate access to pages where OutSystems native validations must be disabled. For example, the PDF component that forces the page that contains the report cannot have authentication enabled. Keep Safe is the ideal gatekeeper for the components:

  • Ultimate PDF (https://www.outsystems.com/forge/component-overview/5641/ultimate-pdf)
  • Html2PdfConverter (https://www.outsystems.com/forge/component-overview/5641/ultimate-pdf)

Installation

To install Keep Safe, follow these steps:

  1. Download the Keep Safe component from the Forge: https://www.outsystems.com/forge/component-overview/12307/keep-safe
  2. Open Service Studio and click on Manage Dependencies.
  3. Select the KeepSafe module and add it to your application.
  4. Publish your application.

Usage

To use Keep Safe, follow these steps:

  1. In Service Studio, open the page or action where you want to hide the input parameter.
  2. Drag and drop the KeepSafe web block from the KeepSafe module to your page or action.
  3. Set the InputParameter property of the web block to the value you want to hide.
  4. Set the OutputParameter property of the web block to a local variable that will store the hidden value.
  5. Use the OutputParameter variable in your logic as needed.

Example

Here is an example of how to use Keep Safe in a page that generates a PDF report using Ultimate PDF.

  1. Create a page called GenerateReport with an input parameter called ReportId.
  2. Drag and drop the UltimatePDF web block from the UltimatePDF module to your page.
  3. Set the URL property of the web block to GetEntryURL("Report", ReportId), where Report is another page that displays the report content.
  4. Set the Anonymous property of the web block to True, since Ultimate PDF requires anonymous access to generate PDFs from URLs.
  5. Drag and drop the KeepSafe web block from the KeepSafe module to your page.
  6. Set the InputParameter property of the web block to ReportId.
  7. Set the OutputParameter property of the web block to a local variable called HiddenReportId.
  8. In your preparation logic, use an If condition to check if HiddenReportId is equal to ReportId.
  9. If they are equal, proceed with generating the PDF report using Ultimate PDF actions.
  10. If they are not equal, redirect the user to an error page or show a message saying that access is denied.

This way, you can ensure that only users who have access to the ReportId can generate and view the PDF report, and prevent unauthorized access to the Report page by hiding its input parameter with Keep Safe.

Questions and Answers

In this section, you will find some common questions and answers about the Keep Safe component.

What is the purpose of the Keep Safe component?
The Keep Safe component allows you to securely hide the input parameter of a page or action, and to validate the access to pages where OutSystems native validations must be disabled.
How does the Keep Safe component work?
The Keep Safe component uses a web block that encrypts the input parameter and stores it in a session variable. The web block also exposes an output parameter that decrypts the session variable and returns the original value. This way, you can use the output parameter in your logic without exposing the input parameter in the URL or in the browser.
What are some use cases for the Keep Safe component?
The Keep Safe component is useful for scenarios where you need to hide sensitive information from the URL or the browser, such as report IDs, user IDs, or passwords. It is also useful for scenarios where you need to use components that require anonymous access, such as PDF generation components, but still want to control who can access them.