|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.novell.emframe.dev.AuthenticationBroker
Used by iManager to manage authentication and connections to various trees or servers. Can use many different protocols to create connections to trees or servers.
New Namespace related calls have been created to help make more code protocol independent. The hope is we will be able to write code that can work in both LDAP and NDAP environments with minimal logic to handle special cases.
New Methods
There are two new methods. One method getProtocolObject(java.lang.String) was added to AuthenticationBroker.
The method is the same as getAPIObject(java.lang.String) except for two things.
1) It throws AuthBrokerException and
2) It accepts as a parameter the value PROTOCOL_ADMINNAMESPACE.
When this parameter is passed in, it will give you the currently authenticated namespace. Please note,
PROTOCOL_ADMINNAMESPACE cannot be used with the 'old' getAPIObject method.
The second new method is ObjectEntry.getAdminNamespace. getAdminNamespace returns the namespace from the ObjectEntry. This method reduces the need to cast the return object to a Namespace or similar object. You should treat the returning namespace as an AdminNamespace, not as NDSNamespace.
Old Approach
AuthenticationBroker broker = m_context.getAuthenticationBroker();
ObjectEntry m_treeOE = (ObjectEntry) broker.getAPIObject("NDSNamespace");
NDSNamespace m_ns = (NDSNamespace) m_treeOE.getNamespace();
New Approach
AuthenticationBroker broker = m_context.getAuthenticationBroker();
ObjectEntry m_treeOE = (ObjectEntry) broker.getProtocolObject (AuthenticationBroker.PROTOCOL_ADMINNAMESPACE);
AdminNamespace m_ns = m_treeOE.getAdminNamespace();
Creating your own connections
You can get the credentials used to login to iManager using the getAuthNdapName(), getAuthPIdentity(),
and getAuthNdapAccessDomain() calls. You can then use these credentials to attempt to connect to another
back-end resource (database, web service, etc...). Any connections made must be cleaned up by the creator of the
connection.
You can also get a raw JNDI LDAP connection to the directory using getAPIObject( PROTOCOL_JNDI_LDAP ). This hands back a bound JNDI LDAP connection to the directory. The task is responsible for cleaning up this JNDI LDAP connection.
| Field Summary | |
static java.lang.String |
PROTOCOL_ADMINNAMESPACE
Authenticated Namespace. |
static java.lang.String |
PROTOCOL_ALLPROTOCOLS
All available protocols. |
static java.lang.String |
PROTOCOL_ECB
EJBs using reflection. |
static java.lang.String |
PROTOCOL_JNDI_LDAP
JNDI connections over LDAP. |
static java.lang.String |
PROTOCOL_LDAPNAMESPACE
LDAP connections. |
static java.lang.String |
PROTOCOL_NAAS
NSure Audit. |
static java.lang.String |
PROTOCOL_NCS
Clustering file system. |
static java.lang.String |
PROTOCOL_NDPS
NDPS connections. |
static java.lang.String |
PROTOCOL_NDSNAMESPACE
NCP connections. |
static java.lang.String |
PROTOCOL_NPSFILE
CIFS access for Novell Portal Services. |
static java.lang.String |
PROTOCOL_NSS
NSS file system. |
static java.lang.String |
PROTOCOL_PORTALCONNECTION
Novell Portal Services connections. |
| Method Summary | |
void |
addAuthBrokerListener(AuthBrokerListener newListener)
Adds a listener to for notification of Authentication Broker events. |
java.lang.Object |
checkAPIObject(java.lang.String protocolId)
Method to check for the associated APIObject with the specified protocol id. |
static AuthenticationBroker |
createAuthenticationBroker(java.lang.String ldapName,
java.lang.String ndapName,
java.lang.String password,
java.lang.String ldapAccessDomain,
java.lang.String ndapAccessDomain,
boolean useLdapSSL,
ManagementServiceSet manageSS)
Returns an AuthenticationBroker. |
static AuthenticationBroker |
createAuthenticationBroker(java.lang.String ldapName,
java.lang.String ndapName,
java.lang.String password,
java.lang.String ldapAccessDomain,
java.lang.String ndapAccessDomain,
boolean useLdapSSL,
ManagementServiceSet manageSS,
java.lang.String portalTreename)
Deprecated. In iManager 2.5, there is no concept of a portal tree. Use the other createAuthenticationBroker instead without the portalTreename variable. |
protected void |
finalize()
Clean up the protocols when garbage is collected. |
java.lang.Object |
getAPIObject(java.lang.String protocolId)
Method to get the associated APIObject with the specified protocol id. |
java.lang.Object |
getAPIObject(java.lang.String protocolId,
java.util.Properties properties)
This is the method to get the required APIObject using a protocol based upon LazyAuthentication. |
AuthBrokerReport |
getAPIReport(java.lang.String protocolId)
Similar to the getAPIObject call. |
java.lang.String |
getAuthLdapAccessDomain()
Gets the LDAP address required to log in to LDAP protocols with. |
java.lang.String |
getAuthLdapDefaultClearPort()
Based upon the LDAP server and LDAP group object of eDir, this returns the port number to use for clear LDAP access. |
java.lang.String |
getAuthLdapDefaultSSLPort()
Based upon the LDAP server and LDAP group object of eDir, this returns the port number to use for SSL LDAP access. |
java.lang.String |
getAuthLdapName()
Gets the fully qualified LDAP user name associated with this authentication broker. |
java.lang.String |
getAuthNdapAccessDomain()
Gets the NDAP address required to log in to NDAP protocols with. |
java.lang.String |
getAuthNdapName()
Gets the full NDAP user name in "." format associated with this authentication broker. |
java.lang.String |
getAuthPIdentity()
Gets the password used to log into this tree. |
java.lang.String |
getAuthTreeName()
Gets the tree name to where this broker will be connecting the protocols. |
boolean |
getAuthUseLdapSSL()
Gets the full NDAP user name in "." format associated with this authentication broker. |
java.lang.String[] |
getIdentity()
Gets a String array containing all identity information. |
java.lang.Object |
getProtocolObject(java.lang.String protocolId)
Method to get the associated protocol object with the specified protocol id. |
boolean |
isUsingNPSTree()
Deprecated. No replacement since NPS has been removed in iManager 2.5. |
void |
logoutAll()
Log out of all active protocols that have been accessed. |
void |
removeAuthBrokerListener(AuthBrokerListener oldListener)
Removes a listener from notification of Authentication Broker events. |
static void |
staticDestroyAll()
The anti-method to initializing the protocols once for all instances of the AuthenticationBroker. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String PROTOCOL_ADMINNAMESPACE
public static final java.lang.String PROTOCOL_ALLPROTOCOLS
public static final java.lang.String PROTOCOL_ECB
public static final java.lang.String PROTOCOL_JNDI_LDAP
public static final java.lang.String PROTOCOL_LDAPNAMESPACE
public static final java.lang.String PROTOCOL_NAAS
public static final java.lang.String PROTOCOL_NCS
public static final java.lang.String PROTOCOL_NDPS
public static final java.lang.String PROTOCOL_NDSNAMESPACE
public static final java.lang.String PROTOCOL_NPSFILE
public static final java.lang.String PROTOCOL_NSS
public static final java.lang.String PROTOCOL_PORTALCONNECTION
| Method Detail |
public void addAuthBrokerListener(AuthBrokerListener newListener)
throws AuthBrokerException
newListener - listener to be added.
AuthBrokerException - if the new listener is null or of the wrong class type an AuthBrokerException
is thrownremoveAuthBrokerListener(com.novell.emframe.dev.AuthBrokerListener)
public java.lang.Object checkAPIObject(java.lang.String protocolId)
throws AuthBrokerException
protocolId - - the protocol that is being requested
AuthBrokerException - - an exceptiongetAPIObject(java.lang.String)
public static AuthenticationBroker createAuthenticationBroker(java.lang.String ldapName,
java.lang.String ndapName,
java.lang.String password,
java.lang.String ldapAccessDomain,
java.lang.String ndapAccessDomain,
boolean useLdapSSL,
ManagementServiceSet manageSS)
ldapName - The username in fully qualified LDAP format. If not
provided this should be set to null. This parameter is
optional, however at least a ldapName or a ndapName must be
provided. Both may also be provided.
Example: "cn=admin,ou=provo,o=novell"ndapName - The full username in NDAP "." format. If not provided this
should be set to null. This parameter is optional, however
at least a ldapName or a ndapName must be provided. Both
may also be provided.
Example: "admin.provo.novell"password - the users passwordldapAccessDomain - The IP address or dns name of the ldap server to connect to.
An optional port may be provided as a colon separated part of
the address. If not provided this should be set to null.
This parameter is optional, however at least a
ldapAccessDomain or a ndapAccessDomain must be provided.
Both may also be provided.ndapAccessDomain - The tree - this is preferred to be an IP address but may be
a tree name If it is a tree name the API's must be able to
locate the tree via the available discovery mechanisms. If
it is an IP address, an optional port may be provided as a
colon separated part of the address. If this parameter is
not provided it should be set to null. This parameter is
optional, however at least a ldapAccessDomain or a
ndapAccessDomain must be provided. Both may also be
provided.useLdapSSL - Flag set to true if SSL binds should be used for LDAP type
protocols. If a port is provided as part of the
ldapAccessDomain, it must be the correct port to use SSL.manageSS - The management service set for this authentication broker. This value
will be cached for later use.
public static AuthenticationBroker createAuthenticationBroker(java.lang.String ldapName,
java.lang.String ndapName,
java.lang.String password,
java.lang.String ldapAccessDomain,
java.lang.String ndapAccessDomain,
boolean useLdapSSL,
ManagementServiceSet manageSS,
java.lang.String portalTreename)
ldapName - The username in fully qualified LDAP format. If not
provided this should be set to null. This parameter is
optional, however at least a ldapName or a ndapName must be
provided. Both may also be provided.
Example: "cn=admin,ou=provo,o=novell"ndapName - The full username in NDAP "." format. If not provided this
should be set to null. This parameter is optional, however
at least a ldapName or a ndapName must be provided. Both
may also be provided.
Example: "admin.provo.novell"password - the users passwordldapAccessDomain - The IP address or dns name of the ldap server to connect to.
An optional port may be provided as a colon separated part of
the address. If not provided this should be set to null.
This parameter is optional, however at least a
ldapAccessDomain or a ndapAccessDomain must be provided.
Both may also be provided.ndapAccessDomain - The tree - this is preferred to be an IP address but may be
a tree name If it is a tree name the API's must be able to
locate the tree via the available discovery mechanisms. If
it is an IP address, an optional port may be provided as a
colon separated part of the address. If this parameter is
not provided it should be set to null. This parameter is
optional, however at least a ldapAccessDomain or a
ndapAccessDomain must be provided. Both may also be
provided.useLdapSSL - Flag set to true if SSL binds should be used for LDAP type
protocols. If a port is provided as part of the
ldapAccessDomain, it must be the correct port to use SSL.manageSS - The management service set for this authentication broker. This value
will be cached for later use.portalTreename - The name of the tree the portal we are using is associated with.
protected void finalize()
throws java.lang.Throwable
java.lang.Throwable - because the super.finalize did and we just pass that on.
public java.lang.Object getAPIObject(java.lang.String protocolId)
throws AuthBrokerWrappedRuntimeException
To return the AdminNamespace that is currently authenticated, use getProtocolObject instead.
This call will return an Object that you can use to communicate with the directory. The AuthenticationBroker has been modified to create the protocol and login the first time the protocol is requested. An exception could be thrown to the user the first time the user request that specific protocol. It is thrown as a runtime exception that ecapsulated the real exception so that current callers do not have to change.
Generally, you will use PROTOCOL_NDSNAMESPACE and get back an ObjectEntry Object. You can also get a raw JNDI LDAP connection to the directory using getAPIObject( PROTOCOL_JNDI_LDAP ). This hands back a bound JNDI LDAP connection to the directory. The task is responsible for cleaning up this JNDI LDAP connection.
protocolId - - the protocol that is being requested
AuthBrokerWrappedRuntimeException - - a runtime exception that need not be caught
but contains error information if unable to successfully login into the
protocol the first time.checkAPIObject(java.lang.String),
getAPIReport(java.lang.String),
getProtocolObject(java.lang.String)
public java.lang.Object getAPIObject(java.lang.String protocolId,
java.util.Properties properties)
throws AuthBrokerException
Note: If the requested protocol is not an implementation of Lazy Authentication an error will be thrown
To return the AdminNamespace that is currently authenticated, use getProtocolObject instead.
protocolId - - identifies which Lazy protocol to use.properties - - additional paramaters for the authenticate method of the protocol
AuthBrokerExceptiongetProtocolObject(java.lang.String)
public AuthBrokerReport getAPIReport(java.lang.String protocolId)
throws AuthBrokerException
protocolId - The protocol that is being requested
AuthBrokerException - - a exception from the Authenticator's login method
if login was not successfulgetAPIObject(java.lang.String)public java.lang.String getAuthLdapAccessDomain()
public java.lang.String getAuthLdapDefaultClearPort()
public java.lang.String getAuthLdapDefaultSSLPort()
public java.lang.String getAuthLdapName()
throws AuthBrokerException
AuthBrokerException - if there is an authentication problempublic java.lang.String getAuthNdapAccessDomain()
public java.lang.String getAuthNdapName()
throws AuthBrokerException
AuthBrokerException - if there is an authentication problempublic java.lang.String getAuthPIdentity()
public java.lang.String getAuthTreeName()
public boolean getAuthUseLdapSSL()
throws AuthBrokerException
AuthBrokerException - if there is a problem with SSL communicationpublic java.lang.String[] getIdentity()
public java.lang.Object getProtocolObject(java.lang.String protocolId)
throws AuthBrokerException
The AuthenticationBroker has been modified to create the protocol and login the first time the protocol is requested. An exception could be thrown to the user the first time the user request that specific protocol.
protocolId - String containing the protocol that is being requested
AuthBrokerException - A runtime exception that need not be caught
but contains error information if unable to successfully login into the
protocol the first time.getAPIObject(java.lang.String),
checkAPIObject(java.lang.String),
getAPIReport(java.lang.String)public boolean isUsingNPSTree()
public void logoutAll()
public void removeAuthBrokerListener(AuthBrokerListener oldListener)
throws AuthBrokerException
oldListener - listener to be added.
AuthBrokerException - if the old listener to remove is null or of the wrong class type an
AuthBrokerException is thrown. An exception is not thrown if the old listener is not found
as a registered listener.addAuthBrokerListener(com.novell.emframe.dev.AuthBrokerListener)public static void staticDestroyAll()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||