Nitido Inc.

com.nitido.nim
Class AuthenticationService

java.lang.Object
  extended by com.nitido.nim.NiMKernelService
      extended by com.nitido.nim.AuthenticationService
All Implemented Interfaces:
NiMConstants
Direct Known Subclasses:
AuthenticationServiceImpl, AuthenticationServiceImpl, AuthenticationServiceImpl, AuthenticationServiceImpl

public abstract class AuthenticationService
extends NiMKernelService

The AuthenticationService is the NiMKernel component responsible for the authentication of entity credentials.


Field Summary
 
Fields inherited from interface com.nitido.nim.NiMConstants
ACTION_CREATE_NUGGET, ACTION_CREATE_NUGGET_BY_NAME, ACTION_CRED_SPACE_ADD, ACTION_CRED_SPACE_GET_KEYS, ACTION_CRED_SPACE_GET_KEYS_START_WITH, ACTION_CRED_SPACE_GET_VALUE, ACTION_CRED_SPACE_GET_VALUES, ACTION_CRED_SPACE_MODIFY, ACTION_CRED_SPACE_REMOVE_VALUE, ACTION_CRED_SPACE_REMOVE_VALUES, ACTION_CRED_SPACE_REPLACE, ACTION_DEPROVISION_ENTITY, ACTION_ENTITY_CHANGE_CRED, ACTION_LOG_EVENT, ACTION_PROVISION_ENTITY, ACTION_USER_SPACE_ADD, ACTION_USER_SPACE_GET_KEYS, ACTION_USER_SPACE_GET_KEYS_START_WITH, ACTION_USER_SPACE_GET_VALUE, ACTION_USER_SPACE_GET_VALUES, ACTION_USER_SPACE_MODIFY, ACTION_USER_SPACE_REMOVE_VALUE, ACTION_USER_SPACE_REMOVE_VALUES, ACTION_USER_SPACE_REPLACE, CONF_PREFIX_SECURITY_ACCESS, CONF_PREFIX_SECURITY_ALLOW, CONF_PREFIX_SECURITY_ASSIGN, CONF_PREFIX_SECURITY_RESOURCE, PARAM_CHANGE_CRED, PARAM_DEPROVISION_CREDENTIAL, PARAM_EVENT_NAME, PARAM_MODIFIER_CONTAINER, PARAM_NUGGET_CREATE_CRED, PARAM_NUGGET_NAME, PARAM_NUGGET_SETTINGS, PARAM_NUGGET_TYPE, PARAM_PROVISION_DESCRIPTOR, PARAM_SPACE_KEY, PARAM_SPACE_KEYS_START_WITH, PARAM_SPACE_VALUE, PREFIX_ACCESS_CLASS_IN_PACKAGE
 
Constructor Summary
AuthenticationService(NiMKernelServiceVisa visa)
          This class constructor is used by the NiMKernel to instantiate a new AuthenticationService.
 
Method Summary
 Credential authenticate(Credential cred)
          This method forwards the call to authenticateImpl() method and then sets the authenticated flag of the credential to true.
protected abstract  Credential authenticateImpl(Credential cred)
          This method is used to authenticate the given credential against the back-end authentication service.
abstract  void changeAuthenticationCredential(Credential oldCred, Credential newCred)
          This method is used to change the identifying credentials on an entity.
protected abstract  void init(NiMKernel kernel, ConfigurationService confService)
          This method is used to initialize the kernel service.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthenticationService

public AuthenticationService(NiMKernelServiceVisa visa)
This class constructor is used by the NiMKernel to instantiate a new AuthenticationService.

Parameters:
visa - Reference to the NiMKernelServiceVisa object required to instantiate the service. This parameter is required to ensure that only the NiMkernel can instantiate a reference to this service.
Method Detail

init

protected abstract void init(NiMKernel kernel,
                             ConfigurationService confService)
                      throws InitializationFailedException,
                             NiMException
Description copied from class: NiMKernelService
This method is used to initialize the kernel service. Extenders of this class must implement this method.

Specified by:
init in class NiMKernelService
Parameters:
kernel - Reference to the NiMKernel object that instantiated the service.
confService - A reference to the configuration service. All the service implementations (except ConfigurationService) should retrieve the setting information from it.
Throws:
InitializationFailedException - If unable to initialize the kernel service.
NiMException - If service initialization can not be done due to failure in establish a connection to the back-end service. Not all service implementation will throw this exception.

authenticate

public final Credential authenticate(Credential cred)
                              throws AuthenticationFailedException,
                                     IllegalCredentialException,
                                     NiMException
This method forwards the call to authenticateImpl() method and then sets the authenticated flag of the credential to true.

Parameters:
cred - The credential to authenticate against the back-end service.
Returns:
A Credential object that represents the tokens after the authentication. This credential is different from the one passed in the parameter. The returning credential is an "authenticated" credential and the caller should use it instead of the credential passed in as the parameter.
Throws:
AuthenticationFailedException - If unable to authenticate the given credential
IllegalCredentialException - If the credential is invalid or belongs to a type that is not supported by the AuthenticationService implementation.
NiMException - If the kernel service fails to connect to back-end authentication system.

authenticateImpl

protected abstract Credential authenticateImpl(Credential cred)
                                        throws AuthenticationFailedException,
                                               IllegalCredentialException,
                                               NiMException
This method is used to authenticate the given credential against the back-end authentication service.

Parameters:
cred - The credential to authenticate against the back-end service.
Returns:
A Credential object that represents the tokens after the authentication. NOTE: even the tokens are not changed during the authentication, this method should still create a cloned instance of the original Credential. It should never return the original credential.
Throws:
AuthenticationFailedException - If unable to authenticate the given credential
IllegalCredentialException - If the credential is invalid or belongs to a type that is not supported by this AuthenticationService.
NiMException - If the kernel service fails to connect to back-end authentication system.

changeAuthenticationCredential

public abstract void changeAuthenticationCredential(Credential oldCred,
                                                    Credential newCred)
                                             throws AuthenticationFailedException,
                                                    IllegalCredentialException,
                                                    NiMException
This method is used to change the identifying credentials on an entity.

Parameters:
oldCred - The original credential
newCred - The new credential
Throws:
AuthenticationFailedException - If unable to authenticate the given credential
IllegalCredentialException - If the credential is invalid or belongs to a type that is not supported by this AuthenticationService.
NiMException - If the kernel service fails to connect to back-end authentication system.

Nitido NiM 2.5 Java API

These JavaDoc pages are generated for release/nim_2_5-2.5.44

Copyright © 1999-2009 Nitido Inc.    Proprietary and Confidential.    All Rights Reserved.