createVaultSlot()

Creates a new credential vault slot in the user managed vault segment. It returns a string that contains the ID of the newly created slot.

This function produces an error if slot creation fails for any reason.

Syntax

portalLib.createVaultSlot(
  resourceName STRING in, 
  secretType SecretKind, 
  active Boolean, 
  portletPrivate Boolean)
returns (value STRING)
resourceName
A string value that contains the name of the resource that is used to create the slot. This identifier is used in the Credential Vaults backing system to uniquely identify a vault slot. This value can be any meaningful string.
secretType
A value of enumerated type SecretKind that indicates the form in which the secret for the vault slot will be passed.
active
A Boolean value that indicates whether active credentials will be used. EGL portalLib functions only support passive credentials, which are simply containers for the secret. The developer must extract the user ID and password from the credential and handle system authentication.
portletPrivate
A Boolean value that indicates whether the credential is specific to this portlet. If portletPrivate is true, the newly created slot will contain one secret per user. The secret will be specific to a single portlet. When false, the slot will contain one secret per user that will be accessible from all portlets for that user.
value
A string that contains the Portal container-generated slotID of the newly created vault slot. The developer must save this value in order to reference the slot in the future. It is common practice to store this value in a portlet preference.

Example

//Create a shared user slot that will contain one secret per user
slotId STRING;
slotId = portalLib.createVaultSlot("myResource", 
         SecretKind.stringValues, false, false);

Feedback