org.openeai.implementations.services.eas
Class AuthManager


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.implementations.services.eas.AuthManager


public class AuthManager
extends OpenEaiObject

The AuthManager class provides convenience methods for user authentication and authorization. It works with the EnterpriseApplicationService to validate and create Enterprise and Application Session objects using the OpenEAI foundation.

This object can be used by many differnt types of web development technologies. For example, Servlets and JSP.

Configuration Parameters:

These are the configuration parameters required by the AuthManager component. These are specified in a single Deployment document for the AuthManager component. Applications wishing to use this component need only create a standard OpenEAI Application Properties object and pass that properties object to the constructor of this class. This Properties object contains all the information necessary for the AuthManager component to initialize itself with its deployment document (providerUrl, initialContextFactory, securityPrincipal, securityCredentials, configDocName, messageComponentName).

Name Required Description
ProducerConfig yes A PointToPoint Producer pool that the AuthManager uses to interact with the EnterpriseApplicationService. This producers should be named "AppServiceProducer" and should be configured so that it will produce requests to the queue onwhich the EnterpriseApplicationService is listening.
MessageObjectConfigs yes Six (6) MessageObjects are required by the AuthManager. They are:
  • EnterpriseUser (Query)
  • NetId
  • Identifier
  • EnterpriseUserPermission (Query)
  • EnterpriseSession (Query, Create)
  • ApplicationSession (Query, Create, Update)
These objects are used when messaging with the EnterpriseApplicationService to validate, create and update session information. The should be configured appropriately to support the actions listed beside them.

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
See Also:
AppConfig, MessageObjectConfig, ProducerConfig

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
AuthManager()
           
AuthManager(java.util.Properties props)
          Takes the Properties object passed in and instantiates an AppConfig object that will be used by this AuthManager object to interact with the EnterpriseApplicationService.
 
Method Summary
 org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession createApplicationSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
          Creates an ApplicationSession object in the EnterpriseApplicationService for the EnterpriseSession passed in.
 void deleteApplicationSession(java.lang.String deleteAction, org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
          Deletes the ApplicationSession object passed in from the EnterpriseApplicationService by performing an ApplicationSession-Delete-Request.
 AppConfig getAppConfig()
          Returns the AppConfig object associated to this AuthManager.
 java.lang.String getAuthUserId()
          Returns the AuthUserId associated to this AuthManager.
 java.lang.String getAuthUserSignature()
          Returns the AuthUserSignature associated to this AuthManager.
 ProducerPool getProducerPool()
          Returns the ProducerPool object associated to this AuthManager.
 java.lang.String getSenderAppId()
          Returns the SenderAppId associated to this AuthManager that will be used by objects as messages are sent.
 java.lang.String getUuidGenUri()
          Returns the UUID generation URL associated to this AuthManager.
 boolean hasPermission(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession, java.lang.String permissionName)
          Determines if the user associated to the ApplicationSession passed is granted the permission passed in.
 void setAppConfig(AppConfig aConfig)
          Sets the AppConfig object associated to this AuthManager.
 void setAuthUserId(java.lang.String userId)
          Sets the AuthUserId associated to this AuthManager.
 void setAuthUserSignature(java.lang.String signature)
          Sets the AuthUserSignature associated to this AuthManager.
 void setProducerPool(ProducerPool pool)
          Sets the ProducerPool object associated to this AuthManager.
 void setSenderAppId(java.lang.String appId)
          Sets the SenderAppId associated to this AuthManager.
 void setUuidGenUri(java.lang.String uri)
          Sets the UUID generation URL associated to this AuthManager.
 org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession updateApplicationSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
          Updates an ApplicationSession object in the EnterpriseApplicationService.
 org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession validateApplicationSession(java.lang.String appSessionId)
          Takes the application session id passed in and queries the EnterpriseApplicationService for the ApplicationSession associated to that id.
 org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession validateEnterpriseSession(java.lang.String sessionId)
          Takes the enterprise session id passed in and queries the EnterpriseApplicationService for the EnterpriseSession associated to that id.
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AuthManager


public AuthManager()

AuthManager


public AuthManager(java.util.Properties props)
            throws java.lang.Exception
Takes the Properties object passed in and instantiates an AppConfig object that will be used by this AuthManager object to interact with the EnterpriseApplicationService.

Method Detail

validateApplicationSession


public org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession validateApplicationSession(java.lang.String appSessionId)
                                                                                                             throws AuthManagerException
Takes the application session id passed in and queries the EnterpriseApplicationService for the ApplicationSession associated to that id. If a valid ApplicationSession is found, it will be returned, if not, null will be returned.

Returns:
ApplicationSession if the appSessionId passed in is a valid ApplicationSessionId, null if not.
Throws:
AuthManagerException - if errors occur validating the ApplicationSesssion.

deleteApplicationSession


public void deleteApplicationSession(java.lang.String deleteAction,
                                     org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
                              throws AuthManagerException
Deletes the ApplicationSession object passed in from the EnterpriseApplicationService by performing an ApplicationSession-Delete-Request.

Throws:
AuthManagerException - if errors occur.

createApplicationSession


public org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession createApplicationSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession entSession)
                                                                                                           throws AuthManagerException
Creates an ApplicationSession object in the EnterpriseApplicationService for the EnterpriseSession passed in.

Returns:
ApplicationSession the ApplicationSession created in the EnterpriseApplicationService.
Throws:
AuthManagerException - if errors occur.

updateApplicationSession


public org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession updateApplicationSession(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession)
                                                                                                           throws AuthManagerException
Updates an ApplicationSession object in the EnterpriseApplicationService. This allows users to pass ApplicationSession SessionEnvironment information from page to page and store that environment information in the EnterpriseApplicationService. NOTE: The only information that will be updated is the SessionEnvironment. The ApplicationSession passed in is first validated and then the SessionEnvironment information associated to that session is updated in the service.

Returns:
ApplicationSession the ApplicationSession updated in the EnterpriseApplicationService.
Throws:
AuthManagerException - if errors occur.

validateEnterpriseSession


public org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.EnterpriseSession validateEnterpriseSession(java.lang.String sessionId)
                                                                                                           throws AuthManagerException
Takes the enterprise session id passed in and queries the EnterpriseApplicationService for the EnterpriseSession associated to that id. If a valid EnterpriseSession is found, it will be returned, if not, null will be returned.

Returns:
EnterpriseSession if the sessionId passed in is a valid EnterpriseSessionId, null if not.
Throws:
AuthManagerException - if errors occur validating the ApplicationSesssion.

hasPermission


public boolean hasPermission(org.any_openeai_enterprise.moa.jmsobjects.coreapplication.v1_0.ApplicationSession appSession,
                             java.lang.String permissionName)
                      throws AuthManagerException
Determines if the user associated to the ApplicationSession passed is granted the permission passed in. Takes the ApplicationSession and permission name passed in and queries the EnterpriseApplicationService to see if the user associated to the ApplicationSession has the permission specified.

Returns:
boolean if the user does have the specified permission, returns true otherwise returns false.
Throws:
AuthManagerException - if errors occur.

setProducerPool


public void setProducerPool(ProducerPool pool)
Sets the ProducerPool object associated to this AuthManager. These producers will be used to message with the EnterpriseApplicationService.


getProducerPool


public ProducerPool getProducerPool()
Returns the ProducerPool object associated to this AuthManager. These producers will be used to message with the EnterpriseApplicationService.

Returns:
ProducerPool

setAppConfig


public void setAppConfig(AppConfig aConfig)
Sets the AppConfig object associated to this AuthManager. This configuration information is stored in a separate deployment document that applications just refer to in their AuthManagerProperties.


getAppConfig


public AppConfig getAppConfig()
Returns the AppConfig object associated to this AuthManager. This configuration information is stored in a separate deployment document that applications just refer to in their AuthManagerProperties.


setSenderAppId


public void setSenderAppId(java.lang.String appId)
Sets the SenderAppId associated to this AuthManager. This is specified in the application's AuthManagerProperties. Messages that are sent by this component (EnterpriseSession, ApplicaitionSession and EnterpriseUserPermission) use this information to set those object's "Authentication" information when messages are sent. To put it simply, this is the SenderAppId for the application using this AuthManager. (e.g. - edu.uillinois.aits.PaymasterBatchErrorViewer)


getSenderAppId


public java.lang.String getSenderAppId()
Returns the SenderAppId associated to this AuthManager that will be used by objects as messages are sent. This is specified in the application's AuthManagerProperties. Messages that are sent by this component (EnterpriseSession, ApplicaitionSession and EnterpriseUserPermission) use this information to set those object's "Authentication" information when messages are sent. To put it simply, this is the SenderAppId for the application using this AuthManager. (e.g. - edu.uillinois.aits.PaymasterBatchErrorViewer)

Returns:
String the senderAppId that should be associated to messages as they are sent.

setAuthUserId


public void setAuthUserId(java.lang.String userId)
Sets the AuthUserId associated to this AuthManager. This is specified in the application's AuthManagerProperties. Messages that are sent by this component (EnterpriseSession, ApplicaitionSession and EnterpriseUserPermission) use this information to set those object's "Authentication" information when messages are sent.


getAuthUserId


public java.lang.String getAuthUserId()
Returns the AuthUserId associated to this AuthManager. This is specified in the application's AuthManagerProperties. Messages that are sent by this component (EnterpriseSession, ApplicaitionSession and EnterpriseUserPermission) use this information to set those object's "Authentication" information when messages are sent.

Returns:
String the AuthUserId that should be associated to messages as they are sent.

setAuthUserSignature


public void setAuthUserSignature(java.lang.String signature)
Sets the AuthUserSignature associated to this AuthManager. This is specified in the application's AuthManagerProperties. Messages that are sent by this component (EnterpriseSession, ApplicaitionSession and EnterpriseUserPermission) use this information to set those object's "Authentication" information when messages are sent.

This particular value is stored with the EnterpriseApplicationService and ensures that no one except those with access to the AuthManagerProperties for this application knows this "secret" information. The information specified in the AuthManagerProperties must match the information stored with the EnterpriseApplicationService and is specific to an application (SenderAppId).


getAuthUserSignature


public java.lang.String getAuthUserSignature()
Returns the AuthUserSignature associated to this AuthManager. This is specified in the application's AuthManagerProperties. Messages that are sent by this component (EnterpriseSession, ApplicaitionSession and EnterpriseUserPermission) use this information to set those object's "Authentication" information when messages are sent.

This particular value is stored with the EnterpriseApplicationService and ensures that no one except those with access to the AuthManagerProperties for this application knows this "secret" information. The information specified in the AuthManagerProperties must match the information stored with the EnterpriseApplicationService and is specific to an application (SenderAppId).

Returns:
String the AuthUserSignature that should be associated to messages as they are sent.

setUuidGenUri


public void setUuidGenUri(java.lang.String uri)
Sets the UUID generation URL associated to this AuthManager. This is specified in the application's AuthManagerProperties. A UUID is used to generate ApplicationSessionIds when a valid EnterpriseSession exists. The AuthManager generates these ApplicationSessionIds.

The UUID will be generated using the GenericUuid OpenEAI object. If the url is "localhost" the UUID will be generated locally, otherwise, it will be generated by the service specified in the URL. (UuidGenServlet)


getUuidGenUri


public java.lang.String getUuidGenUri()
Returns the UUID generation URL associated to this AuthManager. This is specified in the application's AuthManagerProperties. A UUID is used to generate ApplicationSessionIds when a valid EnterpriseSession exists. The AuthManager generates these ApplicationSessionIds.

The UUID will be generated using the GenericUuid OpenEAI object. If the url is "localhost" the UUID will be generated locally, otherwise, it will be generated by the service specified in the URL. (UuidGenServlet)

Returns:
String the URL that should be used to generate the UUID used for ApplicationSessionIds


Copyright © 2002, OpenEAI Software Foundation