JVM Enabled User
A JVM enabled user allows you to programmatically log in to a JCR session within the same Java Virtual Machine (JVM) without providing a password. This is supported only when the user account includes the following property:
hipposys:passkey = jvm://
By default, HST users are configured as JVM enabled users.
When to Use a JVM Enabled User
Use a JVM enabled user when you need to obtain a JCR session from a web application running in the same JVM as the Hippo Repository, and you do not want to configure or manage a password for each cluster node or environment. This approach eliminates the need to set and synchronize different passwords across development, test, acceptance, and production (DTAP) environments.
Configuration
To configure a JVM enabled user, add the hipposys:passkey = jvm:// property to the user node as described in Users. For example:
/hippo:configuration: /hippo:users: /myWebappUser: jcr:primaryType: hipposys:user hipposys:active: true hipposys:passkey: jvm://
If you want the user (for example, myWebappUser) to be able to log in through the repository servlet or other external interfaces, you must also configure the hipposys:password property. Without this property, the user can authenticate only as a JVM enabled user and cannot log in through interfaces that require a password.
Programmatic Login Example
To log in as a JVM enabled user, use the following code:
final HippoRepository repository = HippoRepositoryFactory.getHippoRepository("vm://"); JvmCredentials credentials = JvmCredentials.getCredentials("myWebappUser"); session = repository.login(credentials);
This code obtains a JCR session for the user myWebappUser without requiring a password, as long as the user is configured as a JVM enabled user.