Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

com.ibm.wps.portletservice.credentialvault
Interface CredentialVaultService

All Superinterfaces:
org.apache.jetspeed.portlet.service.PortletService

public interface CredentialVaultService
extends org.apache.jetspeed.portlet.service.PortletService

Service that allows to retrieve credentials from the credential vault and to manage vault segments and slots.

Since:
4.1

Field Summary
static java.lang.String PREDEFINED_SLOT_USER_JAAS_SUBJECT
          This is the name of a predefined slot to store transient credentials.
static int SECRET_TYPE_BYTEARRAY
          The user's secret is in binary form.
static int SECRET_TYPE_JAAS_SUBJECT
          The user's secret is a JAAS Subject.
static int SECRET_TYPE_JAVA_OBJECT
          The user's secret is a java object.
static int SECRET_TYPE_NO_SECRET_DATA
          Type for credential objects that do not contain a secret.
static int SECRET_TYPE_UNDEFINED
          Used only for the super class CredentialSecret of the secret classes as secret type.
static int SECRET_TYPE_USERID_STRING_PASSWORD_STRING
          The user's secret is a userid/password pair.
 

Method Summary
 com.ibm.wps.portletservice.credentialvault.CredentialSlotConfig java.util.Map, java.util.Map, int, boolean, boolean, org.apache.jetspeed.portlet.PortletRequest)">createSlot(java.lang.String resourceName, com.ibm.wps.util.ObjectID segmentId, java.util.Map descriptions, java.util.Map keywords, int secretType, boolean active, boolean portletPrivate, org.apache.jetspeed.portlet.PortletRequest portletRequest)
          Deprecated. Use createSlot taking com.ibm.portal.ObjectID segmentId as parameter. Creates a new credential slot. This method should be used by "ordinary" portlets, but not by "admin portlets".
 com.ibm.wps.portletservice.credentialvault.CredentialSlotConfig java.util.Map, java.util.Map, int, boolean, boolean, org.apache.jetspeed.portlet.PortletRequest)">createSlot(java.lang.String resourceName, com.ibm.portal.ObjectID segmentId, java.util.Map descriptions, java.util.Map keywords, int secretType, boolean active, boolean portletPrivate, org.apache.jetspeed.portlet.PortletRequest portletRequest)
          Creates a new credential slot.
 void deleteSlot(java.lang.String slotName)
          Deletes an existing credential slot.
 java.util.Iterator getAccessibleSlots(org.apache.jetspeed.portlet.PortletRequest request)
          Returns an iterator of all credential slots that a portlet is authorized to use
 java.util.List getAllVaultSegments()
          Returns a List of all Vault Segments.
 com.ibm.wps.portletservice.credentialvault.credentials.Credential java.util.Map, org.apache.jetspeed.portlet.PortletRequest)">getCredential(java.lang.String slotId, java.lang.String type, java.util.Map config, org.apache.jetspeed.portlet.PortletRequest request)
          Returns a specific credential.
 java.util.Iterator getCredentialTypes()
          Returns an Iterator over all credential types that are registered in the credential type registry
 com.ibm.wps.util.ObjectID getDefaultUserVaultSegmentId()
          Deprecated. Use getDefaultUserVaultSegmentId returning com.ibm.portal.ObjectID segmentId as parameter. Returns the ObjectID of the default user managed vault segment. Currently there is only one user-managed segment, so this returns the ID of the user managed segment.
 java.lang.String java.util.Locale)">getSlotDescription(java.lang.String slotId, java.util.Locale locale)
          Returns a credential slot's description for the specified locale.
 javax.security.auth.Subject getUserSubject(org.apache.jetspeed.portlet.PortletRequest request)
          Returns the user's JAAS Subject.
 void setCredentialSecretBinary(java.lang.String slotId, byte[] secret, org.apache.jetspeed.portlet.PortletRequest portletRequest)
          Sets a credential's binary secret.
 void setCredentialSecretUserPassword(java.lang.String slotId, java.lang.String userId, char[] password, org.apache.jetspeed.portlet.PortletRequest portletRequest)
          Sets a credential's user/password secret.
 

Field Detail

PREDEFINED_SLOT_USER_JAAS_SUBJECT

public static final java.lang.String PREDEFINED_SLOT_USER_JAAS_SUBJECT
This is the name of a predefined slot to store transient credentials.


SECRET_TYPE_UNDEFINED

public static final int SECRET_TYPE_UNDEFINED
Used only for the super class CredentialSecret of the secret classes as secret type. This type is not used for creating slots.

See Also:
Constant Field Values

SECRET_TYPE_USERID_STRING_PASSWORD_STRING

public static final int SECRET_TYPE_USERID_STRING_PASSWORD_STRING
The user's secret is a userid/password pair.

See Also:
Constant Field Values

SECRET_TYPE_BYTEARRAY

public static final int SECRET_TYPE_BYTEARRAY
The user's secret is in binary form.

See Also:
Constant Field Values

SECRET_TYPE_JAVA_OBJECT

public static final int SECRET_TYPE_JAVA_OBJECT
The user's secret is a java object.

See Also:
Constant Field Values

SECRET_TYPE_NO_SECRET_DATA

public static final int SECRET_TYPE_NO_SECRET_DATA
Type for credential objects that do not contain a secret. The credential only knows where to get the secret.

See Also:
Constant Field Values

SECRET_TYPE_JAAS_SUBJECT

public static final int SECRET_TYPE_JAAS_SUBJECT
The user's secret is a JAAS Subject.

See Also:
Constant Field Values

Method Detail

getCredentialTypes

public java.util.Iterator getCredentialTypes()
Returns an Iterator over all credential types that are registered in the credential type registry

Returns:
Iterator over string objects representing all credential types that are registered in the credential type registry

java.util.Locale)">

getSlotDescription

public java.lang.String getSlotDescription(java.lang.String slotId,
                                           java.util.Locale locale)
                                    throws org.apache.jetspeed.portlet.service.PortletServiceException
Returns a credential slot's description for the specified locale.

Parameters:
slotId - The credential (slot) id.
locale - The description locale. If set to null, the default locale will be used.
Returns:
The credential slot description for the specified locale.
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException - if the description could not been retrieved.

getAccessibleSlots

public java.util.Iterator getAccessibleSlots(org.apache.jetspeed.portlet.PortletRequest request)
                                      throws org.apache.jetspeed.portlet.service.PortletServiceException
Returns an iterator of all credential slots that a portlet is authorized to use

Parameters:
request - The portlet request is needed by the CredentialVault service in order to determine information about the portlet.
Returns:
Iterator over CredentialSlotConfig objects representing all credential slots that a portlet is authorized to use
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException - if the list of slots could not been retrieved.

setCredentialSecretBinary

public void setCredentialSecretBinary(java.lang.String slotId,
                                      byte[] secret,
                                      org.apache.jetspeed.portlet.PortletRequest portletRequest)
                               throws org.apache.jetspeed.portlet.service.PortletServiceException
Sets a credential's binary secret.

Parameters:
slotId - The credential (slot) id.
secret - The credential secret data in binary form.
portletRequest - The portlet request is used to determine parameters like the portlet id and user id.
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException - if the credential secret is not of the type binary or if the secret could not be set.

setCredentialSecretUserPassword

public void setCredentialSecretUserPassword(java.lang.String slotId,
                                            java.lang.String userId,
                                            char[] password,
                                            org.apache.jetspeed.portlet.PortletRequest portletRequest)
                                     throws org.apache.jetspeed.portlet.service.PortletServiceException
Sets a credential's user/password secret.

Parameters:
slotId - The credential (slot) id.
userId - The credential's userId.
password - The credential's password.
portletRequest - The portlet request is used to determine parameters like the portlet id and user id.
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException - if the credential secret is not of the type user/password or if the secret could not be set.

java.util.Map, java.util.Map, int, boolean, boolean, org.apache.jetspeed.portlet.PortletRequest)">

createSlot

public com.ibm.wps.portletservice.credentialvault.CredentialSlotConfig createSlot(java.lang.String resourceName,
                                                                                  com.ibm.wps.util.ObjectID segmentId,
                                                                                  java.util.Map descriptions,
                                                                                  java.util.Map keywords,
                                                                                  int secretType,
                                                                                  boolean active,
                                                                                  boolean portletPrivate,
                                                                                  org.apache.jetspeed.portlet.PortletRequest portletRequest)
                                                                           throws org.apache.jetspeed.portlet.service.PortletServiceException
Deprecated. Use createSlot taking com.ibm.portal.ObjectID segmentId as parameter. Creates a new credential slot. This method should be used by "ordinary" portlets, but not by "admin portlets".

Parameters:
resourceName - Name of the resource
segmentId - Object id of the segment that this slot is created in
descriptions - The slot descriptions as a Map, keyed by their corresponding Locale objects Key: Locale (max length 64 characters) Value: String (max length 255 characters)
keywords - The slot keywords as a Map, keyed by their corresponding Locale objects Key: Locale (max length 64 characters). Can be null. Value: String (max length 255 characters) The map can be null.
secretType - The secrtet type identifier
active - Flag whether this credential may only be returned in form of an active credential object (true) or both as active and passive credential objects (false)
portletPrivate - Flag whether the credential secret is portlet secific (true) or shared between all of a user's portlets (false).
portletRequest - The portlet request.
Returns:
CredentialSlot The Credential Slot configuration
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException

java.util.Map, java.util.Map, int, boolean, boolean, org.apache.jetspeed.portlet.PortletRequest)">

createSlot

public com.ibm.wps.portletservice.credentialvault.CredentialSlotConfig createSlot(java.lang.String resourceName,
                                                                                  com.ibm.portal.ObjectID segmentId,
                                                                                  java.util.Map descriptions,
                                                                                  java.util.Map keywords,
                                                                                  int secretType,
                                                                                  boolean active,
                                                                                  boolean portletPrivate,
                                                                                  org.apache.jetspeed.portlet.PortletRequest portletRequest)
                                                                           throws org.apache.jetspeed.portlet.service.PortletServiceException
Creates a new credential slot. This method should be used by "ordinary" portlets, but not by "admin portlets", because this method only allows to create non system slots. If one of the required parameters is null, an exception is thrown.

Parameters:
resourceName - Name of the resource. Must not be null.
segmentId - ObjectId of the segment that this slot is created in. Must not be null.
descriptions - The slot descriptions as a Map, keyed by their corresponding Locale objects Key: Locale (max length 64 characters) Value: String (max length 255 characters) The map can be null.
keywords - The slot keywords as a Map, keyed by their corresponding Locale objects Key: Locale (max length 64 characters). Can be null. Value: String (max length 255 characters) The map can be null.
secretType - The secrtet type identifier. Must not be null.
active - Flag whether this credential may only be returned in form of an active credential object (true) or both as active and passive credential objects (false)
portletPrivate - Flag whether the credential secret is portlet secific (true) or shared between all of a user's portlets (false).
Returns:
CredentialSlot The credential slot configuration
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException

deleteSlot

public void deleteSlot(java.lang.String slotName)
                throws org.apache.jetspeed.portlet.service.PortletServiceException
Deletes an existing credential slot.

Parameters:
slotName - The credential (slot) id.
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException - Is thrown if the credential slot could not be deleted or found.

getDefaultUserVaultSegmentId

public com.ibm.wps.util.ObjectID getDefaultUserVaultSegmentId()
                                                       throws org.apache.jetspeed.portlet.service.PortletServiceException
Deprecated. Use getDefaultUserVaultSegmentId returning com.ibm.portal.ObjectID segmentId as parameter. Returns the ObjectID of the default user managed vault segment. Currently there is only one user-managed segment, so this returns the ID of the user managed segment.

Returns:
The ObjectID of the default user managed vault segment. exception PortletServiceException Is thrown if the user segment could not be found.
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException

getAllVaultSegments

public java.util.List getAllVaultSegments()
                                   throws org.apache.jetspeed.portlet.service.PortletServiceException
Returns a List of all Vault Segments.

Returns:
List of VaultSegmentConfig objects representing all vault segments.
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException - Is thrown if the segments could not be retrieved.

java.util.Map, org.apache.jetspeed.portlet.PortletRequest)">

getCredential

public com.ibm.wps.portletservice.credentialvault.credentials.Credential getCredential(java.lang.String slotId,
                                                                                       java.lang.String type,
                                                                                       java.util.Map config,
                                                                                       org.apache.jetspeed.portlet.PortletRequest request)
                                                                                throws org.apache.jetspeed.portlet.service.PortletServiceException,
                                                                                       com.ibm.wps.portletservice.credentialvault.CredentialSecretNotSetException
Returns a specific credential.

Parameters:
slotId - The credential (slot) id.
type - The credential type as specified in the credential registry.
config - The backend application specific configuration that is needed to initialize this credential. This is one part of the credential configuration. The credential vault service will usually add further information to this config from other sources: the user's secret from the actual credential store and the credential instance specific parameters from the portal's credential configuration. The map can be null.
request - The portlet request is used to determine information about the portlet.
Returns:
The credential.
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException - if the credential could not been retrieved - either for technical or secuity reasons.
CredentialSecretNotSetException - if the requested credential secret is not set (by the user or admin).

getUserSubject

public javax.security.auth.Subject getUserSubject(org.apache.jetspeed.portlet.PortletRequest request)
                                           throws org.apache.jetspeed.portlet.service.PortletServiceException
Returns the user's JAAS Subject. The JAAS Subject is retrieved from the user object. It is a transient credential.

Parameters:
request - The portlet request is used to determine the user.
Returns:
The user's JAAS Subject.
Throws:
org.apache.jetspeed.portlet.service.PortletServiceException - if the subject could not been retrieved.

Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.