You want to let your app user know when his authentication is expired?
We created two functions in our utilities Business Objects (BOs) which show a dialog informing the app user that his authentication is expired. Here is how you can use them.
Prerequisites – Check if the BOs are available on your instance
You need the following two BOs:
- The client-side Business Object ITIZ_Utilities with the function checkTokenValidity
2. The server-side Business Object SF_Utilities with the function isAlive
3. Also the server-side BO SF_Utilities has to be added as a dependency to the client-side ITIZ_Utilities.
If you can’t find the BOs or if one of the functions is missing you can download them below and import them to your instance.
Step 2 – Configure input mapping of BO
In the input mapping of the function checkTokenValidity in the BO ITIZ_Utilities, you have to set 4 parameters:
- tokenValidFor (Integer): The time (in seconds) a token is valid for on your instance plus additional 30 seconds. Note: Ask your administrator how long a token is valid for as described in section “Background information” of this article.
- checkInterval (Integer): The time interval (in seconds) after which your app will check if the user has an active token. Each iteration will execute the server-side Business Object function call “isAlive”. Note: This function will trigger an empty http request to the server.
- dialogTitle (String): The title of the dialog which pops up during application runtime when the token is invalid.
- dialogText (String): The message of the dialog which pops up during application runtime when the token is invalid.
You can find an example application with the complete configuration and all nessecary BOs down below.
Background information: Simplifier Token in general
On each Simplifier instance an administrator is able to configure if the authentication token will expire in the general settings.
If the token expiry is turned on, the time when the token will expire can be set as well as how often the token validity will be checked in the Simplifier UI.
In the example shown above the Simplifier authentication token will expire after 1 hour. Every 10 seconds a check is performed if the token is still valid.
As long as a user stays active in a Simplifier app or the Simplifier UI the token will be automatically refreshed.
As soon as an app user becomes inactive for a longer period of time than specified in the settings, he will receive an error if he triggers any actions which rely on communication with the server (e.g., Connectors).
To let the user know about the expiry of his Simplifier token during application runtime, we created the functions mentioned above.