| | |
| | | */ |
| | | package org.opends.server.extensions; |
| | | |
| | | |
| | | |
| | | import static org.opends.messages.ExtensionMessages.*; |
| | | import static org.opends.server.config.ConfigConstants.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | |
| | | /** The identity mapper that will be used to map identities. */ |
| | | private IdentityMapper<?> identityMapper; |
| | | |
| | | /** |
| | | * The properties to use when creating a SASL server to process the |
| | | * GSSAPI authentication. |
| | | */ |
| | | /** The properties to use when creating a SASL server to process the GSSAPI authentication. */ |
| | | private HashMap<String, String> saslProps; |
| | | |
| | | /** The fully qualified domain name used when creating the SASL server. */ |
| | |
| | | private volatile LoginContext loginContext; |
| | | private final Object loginContextLock = new Object(); |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates a new instance of this SASL mechanism handler. No |
| | | * initialization should be done in this method, as it should all be |
| | |
| | | super(); |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void initializeSASLMechanismHandler( |
| | | GSSAPISASLMechanismHandlerCfg configuration) throws ConfigException, |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Checks to make sure that the ds-cfg-kdc-address and dc-cfg-realm |
| | | * are both defined in the configuration. If only one is set, then |
| | |
| | | { |
| | | System.setProperty(KRBV_PROPERTY_KDC, kdcAddress); |
| | | System.setProperty(KRBV_PROPERTY_REALM, realm); |
| | | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * During login, callbacks are usually used to prompt for passwords. |
| | | * All of the GSSAPI login information is provided in the properties |
| | |
| | | { |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Returns the fully qualified name either defined in the |
| | | * configuration, or, determined by examining the system |
| | |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * Return the login context. If it's not been initialized yet, |
| | | * create a login context or login using the principal and keytab |
| | | * information specified in the configuration. |
| | |
| | | return loginContext; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Logout of the current login context. |
| | | */ |
| | | /** Logout of the current login context. */ |
| | | private void logout() |
| | | { |
| | | try |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * Creates an login.conf file from information in the specified |
| | | * configuration. This file is used during the login phase. |
| | |
| | | return configFileName; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void finalizeSASLMechanismHandler() { |
| | | logout(); |
| | |
| | | logger.error(INFO_GSSAPI_STOPPED); |
| | | } |
| | | |
| | | |
| | | private void clearProperties() { |
| | | System.clearProperty(KRBV_PROPERTY_KDC); |
| | | System.clearProperty(KRBV_PROPERTY_REALM); |
| | |
| | | System.clearProperty(JAAS_PROPERTY_SUBJECT_CREDS_ONLY); |
| | | } |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void processSASLBind(BindOperation bindOp) |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * Get the underlying GSSException messages that really tell what the |
| | | * problem is. The major code is the GSS-API status and the minor is the |
| | |
| | | return message.toMessage(); |
| | | } |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isPasswordBased(String mechanism) |
| | | { |
| | |
| | | return false; |
| | | } |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isSecure(String mechanism) |
| | | { |
| | |
| | | return true; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationAcceptable( |
| | | SASLMechanismHandlerCfg configuration, List<LocalizableMessage> unacceptableReasons) |
| | |
| | | return isConfigurationChangeAcceptable(newConfig, unacceptableReasons); |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public boolean isConfigurationChangeAcceptable( |
| | | GSSAPISASLMechanismHandlerCfg newConfiguration, |
| | |
| | | return isAcceptable; |
| | | } |
| | | |
| | | |
| | | |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public ConfigChangeResult applyConfigurationChange(GSSAPISASLMechanismHandlerCfg newConfiguration) |
| | | { |