JVM Enabled User

Within one and the same JVM, we support to be able to login a JCR Session programmatically without requiring a password  if and only  if the user to login contains:

hipposys:passkey = jvm:// 

By default for example the HST users are configured to be JVM enabled. 

Use Case

When you want to retrieve a JCR Session from a webapp other than where Hippo Repository runs in, and you don't want to configure and maintain a password in that webapp (or outside the webapp)  per cluster node where the webapp runs, you can choose for a JVM enabled user. Also between DTAP environments, you don't have to worry about setting different passwords per environment. 

Howto

Configuration

For a user as explained in Users, add hipposys:passkey = jvm://. For example

/hippo:configuration:
  /hippo:users:
    /myWebappUser:
      jcr:primaryType: hipposys:user
      hipposys:active: true
      hipposys:passkey: jvm://

note that if you want to be able to login with myWebappUser into the repository servlet, you still need to configure hipposys:password. If you don't have hipposys:password configured,  myWebappUser can only be used as JVM enabled user and not to login with in for example the repository servlet.

Code

final HippoRepository repository = HippoRepositoryFactory.getHippoRepository("vm://");
JvmCredentials credentials = JvmCredentials.getCredentials("myWebappUser");
session = repository.login(credentials);

 

 

 

 

Did you find this page helpful?
How could this documentation serve you better?
On this page
    Did you find this page helpful?
    How could this documentation serve you better?