Oracle Entitlements Server for Java API Reference

com.bea.security
Class CredentialMappingService

java.lang.Object
  |
  +--com.bea.security.PublicSecurityService
        |
        +--com.bea.security.CredentialMappingService

public class CredentialMappingService
extends PublicSecurityService

The Credential Mapping Service may be used to obtain an appropriate set of credentials that have been administratively configured to be used by the requester when attempting to access a specified resource with a specific action.

The CredentialService returns a number of different credential formats. The specific format returned is dependent upon the type of provider that has been configured for the requested resource and action. Two of the primary credential formats returned by the CredentialService are defined by the Java Connector specification.

NOTE: Additional credential formats may also be returned. The caller is responsible for detecting and casting the credential formats to the appropriate Java class.

Author:
Copyright © 2004-2008, Oracle and/or its affiliates. All rights reserved.

Fields inherited from class com.bea.security.PublicSecurityService
COMPATIBLE, COMPATIBLE_DEPRECATED, COMPATIBLE_UNKNOWN, NOT_COMPATIBLE
 
Method Summary
 java.lang.Object getCredential(AuthenticIdentity byident, java.lang.String alias, RuntimeResource resource, RuntimeAction action, AppContext ctx, java.lang.String credtype)
          Gets a credential mapped to a specific alias, resource, and action for an AuthenticIdentity.
 java.lang.Object getCredential(AuthenticIdentity byident, java.lang.String alias, RuntimeResource resource, RuntimeAction action, java.lang.String credtype)
          Gets a credential mapped to a specific alias, resource, and action for an AuthenticIdentity.
 java.util.Vector getCredentials(AuthenticIdentity byident, AuthenticIdentity forident, RuntimeResource resource, RuntimeAction action, AppContext ctx, java.lang.String credtype)
          Gets a set of credentials relevant to a specific resource and action for an AuthenticIdentity.
 java.util.Vector getCredentials(AuthenticIdentity byident, AuthenticIdentity forident, RuntimeResource resource, RuntimeAction action, java.lang.String[] credtypes)
          Gets a set of credentials relevant to a specific resource and action for an AuthenticIdentity.
 ServiceType getServiceType()
          Returns the version of this service
 ServiceVersion getVersion()
          Returns the type of this service.
 int isCompatible(ServiceVersion version)
          Determines if the version of the public service API specified in the Java application is compatible with the current version of the service API in the security runtime instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getServiceType

public ServiceType getServiceType()
Returns the version of this service

Returns:
a ServiceVersion object indicating the version and the patch level of this service.
Overrides:
getServiceType in class PublicSecurityService

getVersion

public ServiceVersion getVersion()
Returns the type of this service.

Returns:
a ServiceType object indicating the service type of this service.
Overrides:
getVersion in class PublicSecurityService

isCompatible

public int isCompatible(ServiceVersion version)
Determines if the version of the public service API specified in the Java application is compatible with the current version of the service API in the security runtime instance.

Parameters:
version - a ServiceVersion which is being asked for by the Java application. The current service, that is, the service in the security runtime instance, will indiciate if it supports the version specified in the isCompatible() method.
Returns:
an int equaling NOT_COMPATIBLE if the service is not compatible with the supplied version, COMPATIBLE if the service is fully compatible, COMPATIBLE_DEPRECATED if the service is compatible, but some functions have been depricated between the versions, or, finally, COMPATIBLE_UNKNOWN if the version passed in is newer than the current version, so compatibility is unknown.
Overrides:
isCompatible in class PublicSecurityService

getCredentials

public java.util.Vector getCredentials(AuthenticIdentity byident,
                                       AuthenticIdentity forident,
                                       RuntimeResource resource,
                                       RuntimeAction action,
                                       java.lang.String[] credtypes)
                                throws IdentityNotAuthenticException,
                                       ParameterException
Gets a set of credentials relevant to a specific resource and action for an AuthenticIdentity.

Parameters:
byident - an AuthenticIdentity of the user requesting this credential set.
forident - an AuthenticIdentity of the user for whom the credentials are being fetched.
resource - the RuntimeResource relevant to this credential mapping.
action - the RuntimeAction relevant to this credential mapping.
credtypes - an array of Strings containing the credential types being requested.
Returns:
a Vector of credentials relevant for the types requested.
  • Password-based credentials are returned as an instance of the class javax.resource.spi.security.PasswordCredential.
  • Other credentials are returned as a class that implements the javax.resource.spi.security.GenericCredential interface.

NOTE: Additional credential formats may also be returned. The caller is responsible for detecting and casting the credential formats to the appropriate Java class.

Throws:
IdentityNotAuthenticException - This exception is thrown if either of the identities provided are invalid or not properly authenticated.
ParameterException - This exception is thrown if any of the arguments or their format is invalid.

getCredentials

public java.util.Vector getCredentials(AuthenticIdentity byident,
                                       AuthenticIdentity forident,
                                       RuntimeResource resource,
                                       RuntimeAction action,
                                       AppContext ctx,
                                       java.lang.String credtype)
                                throws IdentityNotAuthenticException,
                                       ParameterException
Gets a set of credentials relevant to a specific resource and action for an AuthenticIdentity.

Parameters:
byident - an AuthenticIdentity of the user requesting this credential set.
forident - an AuthenticIdentity of the user for whom the credentials are being fetched.
resource - the RuntimeResource relevant to this credential mapping.
ctx - the AppContext callback object that provides application context to the provider for use with the credential mapping
action - the RuntimeAction relevant to this credential mapping.
credtype - a String containing the name of the credential type being requested.
Returns:
a Vector of credentials relevant for the types requested.
  • Password-based credentials are returned as an instance of the class javax.resource.spi.security.PasswordCredential.
  • Other credentials are returned as a class that implements the javax.resource.spi.security.GenericCredential interface.

NOTE: Additional credential formats may also be returned. The caller is responsible for detecting and casting the credential formats to the appropriate Java class.

Throws:
IdentityNotAuthenticException - This exception is thrown if either of the identities provided are invalid or not properly authenticated.
ParameterException - This exception is thrown if any of the arguments or their format is invalid.

getCredential

public java.lang.Object getCredential(AuthenticIdentity byident,
                                      java.lang.String alias,
                                      RuntimeResource resource,
                                      RuntimeAction action,
                                      java.lang.String credtype)
                               throws IdentityNotAuthenticException,
                                      ParameterException
Gets a credential mapped to a specific alias, resource, and action for an AuthenticIdentity.

Parameters:
byident - an AuthenticIdentity of the user requesting this credential.
alias - a String alias (usually username) this credential is mapped to.
resource - the RuntimeResource relevant to this credential mapping.
action - the RuntimeAction relevant to this credential mapping.
credtypes - an array of Strings containing the credential types being requested.
Returns:
an Object which is a credential for this alias. If more than one credential is mapped for the alias, only one is returned. Which one is returned is not guaranteed.
  • Password-based credentials are returned as an instance of the class javax.resource.spi.security.PasswordCredential.
  • Other credentials are returned as a class that implements the javax.resource.spi.security.GenericCredential interface.

NOTE: Additional credential formats may also be returned. The caller is responsible for detecting and casting the credential formats to the appropriate Java class.

Throws:
IdentityNotAuthenticException - This exception is thrown if the requesting identity provided is invalid or not properly authenticated.
ParameterException - This exception is thrown if any of the arguments or their format is invalid.

getCredential

public java.lang.Object getCredential(AuthenticIdentity byident,
                                      java.lang.String alias,
                                      RuntimeResource resource,
                                      RuntimeAction action,
                                      AppContext ctx,
                                      java.lang.String credtype)
                               throws IdentityNotAuthenticException,
                                      ParameterException
Gets a credential mapped to a specific alias, resource, and action for an AuthenticIdentity.

Parameters:
byident - an AuthenticIdentity of the user requesting this credential.
alias - a String alias (usually username) this credential is mapped to.
resource - the RuntimeResource relevant to this credential mapping.
action - the RuntimeAction relevant to this credential mapping.
ctx - the AppContext callback object that provides application context to the provider for use with the credential mapping
credtypes - an array of Strings containing the credential types being requested.
Returns:
an Object which is a credential for this alias. If more than one credential is mapped for the alias, only one is returned. Which one is returned is not guaranteed.
  • Password-based credentials are returned as an instance of the class javax.resource.spi.security.PasswordCredential.
  • Other credentials are returned as a class that implements the javax.resource.spi.security.GenericCredential interface.

NOTE: Additional credential formats may also be returned. The caller is responsible for detecting and casting the credential formats to the appropriate Java class.

Throws:
IdentityNotAuthenticException - This exception is thrown if the requesting identity provided is invalid or not properly authenticated.
ParameterException - This exception is thrown if any of the arguments or their format is invalid.