Update the process that SASL mechanisms use to set authentication info for the
bind operation. Previously, they were setting it directly in the client
connection, which introduced the possibility that a failure in bind processing
which occurred after the SASL credentials were validated could result in a
case in which a failure was returned to the client but the associated connection
could still be authenticated in the server. SASL mechanism handlers will now
set the authentication info in the bind operation and it will only be updated in
the client connection if all processing associated with the bind operation is
successful.
OpenDS Issue Number: 1203
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.api; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Processes the provided SASL bind operation. Note that if the |
| | | * SASL processing gets far enough to be able to map the associated |
| | | * request to a user entry (regardless of whether the authentication |
| | | * is ultimately successful), then this method must call the |
| | | * <CODE>BindOperation.setSASLAuthUserEntry</CODE> to provide it |
| | | * with the entry for the user that attempted to authenticate. |
| | | * Processes the SASL bind operation. SASL mechanism |
| | | * implementations must ensure that the following actions are taken |
| | | * during the processing of this method: |
| | | * <UL> |
| | | * <LI>The {@code BindOperation.setResultCode} method must be used |
| | | * to set the appropriate result code.</LI> |
| | | * <LI>If the SASL processing gets far enough to be able to map |
| | | * the request to a user entry (regardless of whether the |
| | | * authentication is ultimately successful), then this method |
| | | * must call the {@code BindOperation.setSASLAuthUserEntry} |
| | | * method to provide it with the entry for the user that |
| | | * attempted to authenticate.</LI> |
| | | * <LI>If the bind processing was successful, then the |
| | | * {@code BindOperation.setAuthenticationInfo} method must be |
| | | * used to set the authentication info for the bind |
| | | * operation.</LI> |
| | | * <LI>If the bind processing was not successful, then the |
| | | * {@code BindOperation.setAuthFailureReason} method should be |
| | | * used to provide a message explaining why the authentication |
| | | * failed.</LI> |
| | | * </UL> |
| | | * |
| | | * @param bindOperation The SASL bind operation to be processed. |
| | | */ |
| | |
| | | // The server SASL credentials provided to the client in the response. |
| | | private ASN1OctetString serverSASLCredentials; |
| | | |
| | | // The authentication info for this bind operation. |
| | | private AuthenticationInfo authInfo; |
| | | |
| | | // The authentication type used for this bind operation. |
| | | private AuthenticationType authType; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Retrieves the authentication info that resulted from processing this bind |
| | | * operation. It will only be valid if the bind processing was successful. |
| | | * |
| | | * @return The authentication info that resulted from processing this bind |
| | | * operation. |
| | | */ |
| | | public final AuthenticationInfo getAuthenticationInfo() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "getAuthenticationInfo"); |
| | | |
| | | return authInfo; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Specifies the authentication info that resulted from processing this bind |
| | | * operation. This method must only be called by SASL mechanism handlers |
| | | * during the course of processing the {@code processSASLBind} method. |
| | | * |
| | | * @param authInfo The authentication info that resulted from processing |
| | | * this bind operation. |
| | | */ |
| | | public final void setAuthenticationInfo(AuthenticationInfo authInfo) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "setAuthenticationInfo", |
| | | String.valueOf(authInfo)); |
| | | |
| | | this.authInfo = authInfo; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | |
| | | // Wipe out any existing authentication for the client connection and create |
| | | // a placeholder that will be used if the bind is successful. |
| | | clientConnection.setUnauthenticated(); |
| | | AuthenticationInfo authInfo = null; |
| | | authInfo = null; |
| | | |
| | | |
| | | // Abandon any operations that may be in progress for the client. |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Initializes this SASL mechanism handler based on the information in the |
| | | * provided configuration entry. It should also register itself with the |
| | | * Directory Server for the particular kinds of SASL mechanisms that it |
| | | * will process. |
| | | * |
| | | * @param configEntry The configuration entry that contains the information |
| | | * to use to initialize this SASL mechanism handler. |
| | | * |
| | | * @throws ConfigException If an unrecoverable problem arises in the |
| | | * process of performing the initialization. |
| | | * |
| | | * @throws InitializationException If a problem occurs during initialization |
| | | * that is not related to the server |
| | | * configuration. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this SASL mechanism |
| | | * handler. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "finalizeSASLMechanismHandler"); |
| | |
| | | |
| | | |
| | | /** |
| | | * Processes the provided SASL bind operation. Note that if the SASL |
| | | * processing gets far enough to be able to map the associated request to a |
| | | * user entry (regardless of whether the authentication is ultimately |
| | | * successful), then this method must call the |
| | | * <CODE>BindOperation.setSASLAuthUserEntry</CODE> to provide it with the |
| | | * entry for the user that attempted to authenticate. |
| | | * |
| | | * @param bindOperation The SASL bind operation to be processed. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "processSASLBind", |
| | |
| | | // Authenticate the client anonymously and indicate that the bind was |
| | | // successful. |
| | | AuthenticationInfo authInfo = new AuthenticationInfo(); |
| | | bindOperation.getClientConnection().setAuthenticationInfo(authInfo); |
| | | bindOperation.setAuthenticationInfo(authInfo); |
| | | bindOperation.setResultCode(ResultCode.SUCCESS); |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism is password-based or uses |
| | | * some other form of credentials (e.g., an SSL client certificate or Kerberos |
| | | * ticket). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism is password-based, or |
| | | * <CODE>false</CODE> if it uses some other form of credentials. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isPasswordBased", String.valueOf(mechanism)); |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism should be considered secure |
| | | * (i.e., it does not expose the authentication credentials in a manner that |
| | | * is useful to a third-party observer, and other aspects of the |
| | | * authentication are generally secure). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism should be considered |
| | | * secure, or <CODE>false</CODE> if not. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isSecure", String.valueOf(mechanism)); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Initializes this SASL mechanism handler based on the information in the |
| | | * provided configuration entry. It should also register itself with the |
| | | * Directory Server for the particular kinds of SASL mechanisms that it |
| | | * will process. |
| | | * |
| | | * @param configEntry The configuration entry that contains the information |
| | | * to use to initialize this SASL mechanism handler. |
| | | * |
| | | * @throws ConfigException If an unrecoverable problem arises in the |
| | | * process of performing the initialization. |
| | | * |
| | | * @throws InitializationException If a problem occurs during initialization |
| | | * that is not related to the server |
| | | * configuration. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this SASL mechanism |
| | | * handler. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "finalizeSASLMechanismHandler"); |
| | |
| | | |
| | | |
| | | /** |
| | | * Processes the provided SASL bind operation. Note that if the SASL |
| | | * processing gets far enough to be able to map the associated request to a |
| | | * user entry (regardless of whether the authentication is ultimately |
| | | * successful), then this method must call the |
| | | * <CODE>BindOperation.setSASLAuthUserEntry</CODE> to provide it with the |
| | | * entry for the user that attempted to authenticate. |
| | | * |
| | | * @param bindOperation The SASL bind operation to be processed. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "processSASLBind", |
| | |
| | | AuthenticationInfo authInfo = |
| | | new AuthenticationInfo(userEntry.getDN(), SASL_MECHANISM_CRAM_MD5, |
| | | DirectoryServer.isRootDN(userEntry.getDN())); |
| | | bindOperation.getClientConnection().setAuthenticationInfo(authInfo); |
| | | bindOperation.setAuthenticationInfo(authInfo); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism is password-based or uses |
| | | * some other form of credentials (e.g., an SSL client certificate or Kerberos |
| | | * ticket). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism is password-based, or |
| | | * <CODE>false</CODE> if it uses some other form of credentials. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isPasswordBased", String.valueOf(mechanism)); |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism should be considered secure |
| | | * (i.e., it does not expose the authentication credentials in a manner that |
| | | * is useful to a third-party observer, and other aspects of the |
| | | * authentication are generally secure). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism should be considered |
| | | * secure, or <CODE>false</CODE> if not. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isSecure", String.valueOf(mechanism)); |
| | |
| | | |
| | | |
| | | /** |
| | | * Initializes this SASL mechanism handler based on the information in the |
| | | * provided configuration entry. It should also register itself with the |
| | | * Directory Server for the particular kinds of SASL mechanisms that it |
| | | * will process. |
| | | * |
| | | * @param configEntry The configuration entry that contains the information |
| | | * to use to initialize this SASL mechanism handler. |
| | | * |
| | | * @throws ConfigException If an unrecoverable problem arises in the |
| | | * process of performing the initialization. |
| | | * |
| | | * @throws InitializationException If a problem occurs during initialization |
| | | * that is not related to the server |
| | | * configuration. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this SASL mechanism |
| | | * handler. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "finalizeSASLMechanismHandler"); |
| | |
| | | |
| | | |
| | | /** |
| | | * Processes the provided SASL bind operation. Note that if the SASL |
| | | * processing gets far enough to be able to map the associated request to a |
| | | * user entry (regardless of whether the authentication is ultimately |
| | | * successful), then this method must call the |
| | | * <CODE>BindOperation.setSASLAuthUserEntry</CODE> to provide it with the |
| | | * entry for the user that attempted to authenticate. |
| | | * |
| | | * @param bindOperation The SASL bind operation to be processed. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "processSASLBind", |
| | |
| | | AuthenticationInfo authInfo = |
| | | new AuthenticationInfo(userEntry.getDN(), SASL_MECHANISM_DIGEST_MD5, |
| | | DirectoryServer.isRootDN(userEntry.getDN())); |
| | | bindOperation.getClientConnection().setAuthenticationInfo(authInfo); |
| | | bindOperation.setAuthenticationInfo(authInfo); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism is password-based or uses |
| | | * some other form of credentials (e.g., an SSL client certificate or Kerberos |
| | | * ticket). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism is password-based, or |
| | | * <CODE>false</CODE> if it uses some other form of credentials. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isPasswordBased", String.valueOf(mechanism)); |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism should be considered secure |
| | | * (i.e., it does not expose the authentication credentials in a manner that |
| | | * is useful to a third-party observer, and other aspects of the |
| | | * authentication are generally secure). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism should be considered |
| | | * secure, or <CODE>false</CODE> if not. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isSecure", String.valueOf(mechanism)); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Initializes this SASL mechanism handler based on the information in the |
| | | * provided configuration entry. It should also register itself with the |
| | | * Directory Server for the particular kinds of SASL mechanisms that it |
| | | * will process. |
| | | * |
| | | * @param configEntry The configuration entry that contains the information |
| | | * to use to initialize this SASL mechanism handler. |
| | | * |
| | | * @throws ConfigException If an unrecoverable problem arises in the |
| | | * process of performing the initialization. |
| | | * |
| | | * @throws InitializationException If a problem occurs during initialization |
| | | * that is not related to the server |
| | | * configuration. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this SASL mechanism |
| | | * handler. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "finalizeSASLMechanismHandler"); |
| | |
| | | |
| | | |
| | | /** |
| | | * Processes the provided SASL bind operation. Note that if the SASL |
| | | * processing gets far enough to be able to map the associated request to a |
| | | * user entry (regardless of whether the authentication is ultimately |
| | | * successful), then this method must call the |
| | | * <CODE>BindOperation.setSASLAuthUserEntry</CODE> to provide it with the |
| | | * entry for the user that attempted to authenticate. |
| | | * |
| | | * @param bindOperation The SASL bind operation to be processed. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "processSASLBind", |
| | |
| | | AuthenticationInfo authInfo = |
| | | new AuthenticationInfo(userEntry.getDN(), SASL_MECHANISM_EXTERNAL, |
| | | DirectoryServer.isRootDN(userEntry.getDN())); |
| | | clientConnection.setAuthenticationInfo(authInfo); |
| | | bindOperation.setAuthenticationInfo(authInfo); |
| | | bindOperation.setResultCode(ResultCode.SUCCESS); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism is password-based or uses |
| | | * some other form of credentials (e.g., an SSL client certificate or Kerberos |
| | | * ticket). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism is password-based, or |
| | | * <CODE>false</CODE> if it uses some other form of credentials. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isPasswordBased", String.valueOf(mechanism)); |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism should be considered secure |
| | | * (i.e., it does not expose the authentication credentials in a manner that |
| | | * is useful to a third-party observer, and other aspects of the |
| | | * authentication are generally secure). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism should be considered |
| | | * secure, or <CODE>false</CODE> if not. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isSecure", String.valueOf(mechanism)); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Initializes this SASL mechanism handler based on the information in the |
| | | * provided configuration entry. It should also register itself with the |
| | | * Directory Server for the particular kinds of SASL mechanisms that it |
| | | * will process. |
| | | * |
| | | * @param configEntry The configuration entry that contains the information |
| | | * to use to initialize this SASL mechanism handler. |
| | | * |
| | | * @throws ConfigException If an unrecoverable problem arises in the |
| | | * process of performing the initialization. |
| | | * |
| | | * @throws InitializationException If a problem occurs during initialization |
| | | * that is not related to the server |
| | | * configuration. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this SASL mechanism |
| | | * handler. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "finalizeSASLMechanismHandler"); |
| | |
| | | |
| | | |
| | | /** |
| | | * Processes the provided SASL bind operation. Note that if the SASL |
| | | * processing gets far enough to be able to map the associated request to a |
| | | * user entry (regardless of whether the authentication is ultimately |
| | | * successful), then this method must call the |
| | | * <CODE>BindOperation.setSASLAuthUserEntry</CODE> to provide it with the |
| | | * entry for the user that attempted to authenticate. |
| | | * |
| | | * @param bindOperation The SASL bind operation to be processed. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "processSASLBind", |
| | |
| | | AuthenticationInfo authInfo = |
| | | new AuthenticationInfo(userDN, SASL_MECHANISM_GSSAPI, |
| | | DirectoryServer.isRootDN(userDN)); |
| | | clientConnection.setAuthenticationInfo(authInfo); |
| | | bindOperation.setAuthenticationInfo(authInfo); |
| | | bindOperation.setResultCode(ResultCode.SUCCESS); |
| | | |
| | | // FIXME -- If we're using integrity or confidentiality, then we can't do |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism is password-based or uses |
| | | * some other form of credentials (e.g., an SSL client certificate or Kerberos |
| | | * ticket). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism is password-based, or |
| | | * <CODE>false</CODE> if it uses some other form of credentials. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isPasswordBased", String.valueOf(mechanism)); |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism should be considered secure |
| | | * (i.e., it does not expose the authentication credentials in a manner that |
| | | * is useful to a third-party observer, and other aspects of the |
| | | * authentication are generally secure). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism should be considered |
| | | * secure, or <CODE>false</CODE> if not. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isSecure", String.valueOf(mechanism)); |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | AuthenticationInfo authInfo = |
| | | new AuthenticationInfo(userEntry.getDN(), SASL_MECHANISM_GSSAPI, |
| | | DirectoryServer.isRootDN(userEntry.getDN())); |
| | | clientConnection.setAuthenticationInfo(authInfo); |
| | | bindOperation.setAuthenticationInfo(authInfo); |
| | | bindOperation.setResultCode(ResultCode.SUCCESS); |
| | | |
| | | // FIXME -- If we're using integrity or confidentiality, then we can't do |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Portions Copyright 2006 Sun Microsystems, Inc. |
| | | * Portions Copyright 2006-2007 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Initializes this SASL mechanism handler based on the information in the |
| | | * provided configuration entry. It should also register itself with the |
| | | * Directory Server for the particular kinds of SASL mechanisms that it |
| | | * will process. |
| | | * |
| | | * @param configEntry The configuration entry that contains the information |
| | | * to use to initialize this SASL mechanism handler. |
| | | * |
| | | * @throws ConfigException If an unrecoverable problem arises in the |
| | | * process of performing the initialization. |
| | | * |
| | | * @throws InitializationException If a problem occurs during initialization |
| | | * that is not related to the server |
| | | * configuration. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void initializeSASLMechanismHandler(ConfigEntry configEntry) |
| | | throws ConfigException, InitializationException |
| | | { |
| | |
| | | |
| | | |
| | | /** |
| | | * Performs any finalization that may be necessary for this SASL mechanism |
| | | * handler. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void finalizeSASLMechanismHandler() |
| | | { |
| | | assert debugEnter(CLASS_NAME, "finalizeSASLMechanismHandler"); |
| | |
| | | |
| | | |
| | | /** |
| | | * Processes the provided SASL bind operation. Note that if the SASL |
| | | * processing gets far enough to be able to map the associated request to a |
| | | * user entry (regardless of whether the authentication is ultimately |
| | | * successful), then this method must call the |
| | | * <CODE>BindOperation.setSASLAuthUserEntry</CODE> to provide it with the |
| | | * entry for the user that attempted to authenticate. |
| | | * |
| | | * @param bindOperation The SASL bind operation to be processed. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public void processSASLBind(BindOperation bindOperation) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "processSASLBind", |
| | |
| | | AuthenticationInfo authInfo = |
| | | new AuthenticationInfo(userEntry.getDN(), SASL_MECHANISM_PLAIN, |
| | | DirectoryServer.isRootDN(userEntry.getDN())); |
| | | bindOperation.getClientConnection().setAuthenticationInfo(authInfo); |
| | | bindOperation.setAuthenticationInfo(authInfo); |
| | | return; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism is password-based or uses |
| | | * some other form of credentials (e.g., an SSL client certificate or Kerberos |
| | | * ticket). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism is password-based, or |
| | | * <CODE>false</CODE> if it uses some other form of credentials. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isPasswordBased", String.valueOf(mechanism)); |
| | |
| | | |
| | | |
| | | /** |
| | | * Indicates whether the specified SASL mechanism should be considered secure |
| | | * (i.e., it does not expose the authentication credentials in a manner that |
| | | * is useful to a third-party observer, and other aspects of the |
| | | * authentication are generally secure). |
| | | * |
| | | * @param mechanism The name of the mechanism for which to make the |
| | | * determination. This will only be invoked with names of |
| | | * mechanisms for which this handler has previously |
| | | * registered. |
| | | * |
| | | * @return <CODE>true</CODE> if this SASL mechanism should be considered |
| | | * secure, or <CODE>false</CODE> if not. |
| | | * {@inheritDoc} |
| | | */ |
| | | @Override() |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | | assert debugEnter(CLASS_NAME, "isSecure", String.valueOf(mechanism)); |