Entity Manager and EncryptUrlParameters

Using encrypted urls can be useful to add an additional security layer to an application. GX allows the developer to choose to encrypt the urls using a sitewide key or a session key (different for each session). When using a session key urls are only valid during the user session.

However there are many scenarios in which certain urls need to be constant over time and must be shareable among sessions. An example are urls that are stored in the database, which should be valid across sessions.

Some URLs must also be unencrypted as they are linked from external applications that don’t have access to the encryption keys.

To solve this problem there are three alternatives:

  1. Not using encryption at all: In this case, the benefits of encrypting the parameters are lost.
  2. Use site key encryption instead of session key encryption in the entire KB.
  3. Use session key encryption in all the objects except the ones that fall in the scenarios mentioned earlier. In that case either no encryption or site encryption can be used.

If the third alternative is used, the developer can change the encrypt url parameters property of Entity Manager objects, and K2BTools will adapt the generated code to this setting.

In other words, Entity Managers can have a encrypt url parameters value different from the value set in the model level. To change it, simply change the property’s value in the object.

This is useful when the notifications and collaboration module is used, as in that case entity manager urls may be stored as the reference url for a notification.