/** * {@inheritDoc} */ @Override public String getSaslMechanism() { return getDecorated().getSaslMechanism(); }
/** * {@inheritDoc} */ @Override public String getSaslMechanism() { return getDecorated().getSaslMechanism(); }
/** * {@inheritDoc} */ @Override public String getSaslMechanism() { return getDecorated().getSaslMechanism(); }
/** * {@inheritDoc} */ @Override public String getSaslMechanism() { return getDecorated().getSaslMechanism(); }
private void handleSaslAuthPending( LdapSession ldapSession, BindRequest bindRequest ) throws Exception { // First, check that we have the same mechanism String saslMechanism = bindRequest.getSaslMechanism(); // The empty mechanism is also a request for a new Bind session if ( Strings.isEmpty( saslMechanism ) || !ldapSession.getSaslProperty( SaslConstants.SASL_MECH ).equals( saslMechanism ) ) { sendAuthMethNotSupported( ldapSession, bindRequest ); return; } // We have already received a first BindRequest, and sent back some challenge. // First, check if the mechanism is the same MechanismHandler mechanismHandler = handlers.get( saslMechanism ); if ( mechanismHandler == null ) { String message = I18n.err( I18n.ERR_161, saslMechanism ); // Clear the saslProperties, and move to the anonymous state ldapSession.clearSaslProperties(); ldapSession.setAnonymous(); LOG.error( message ); throw new IllegalArgumentException( message ); } // Get the previously created SaslServer instance SaslServer ss = mechanismHandler.handleMechanism( ldapSession, bindRequest ); generateSaslChallengeOrComplete( ldapSession, ss, bindRequest ); }
/** * {@inheritDoc} */ @Override public void action( LdapMessageContainer<BindRequestDecorator> container ) { BindRequest bindRequestMessage = container.getMessage(); TLV tlv = container.getCurrentTLV(); // We have to handle the special case of a 0 length // mechanism if ( tlv.getLength() == 0 ) { bindRequestMessage.setSaslMechanism( "" ); } else { bindRequestMessage.setSaslMechanism( Strings.utf8ToString( tlv.getValue().getData() ) ); } // We can have an END transition container.setGrammarEndAllowed( true ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05118_THE_SASL_MECHANISM_IS, bindRequestMessage.getSaslMechanism() ) ); } } }
/** * {@inheritDoc} */ @Override public void action( LdapMessageContainer<BindRequestDecorator> container ) { BindRequest bindRequestMessage = container.getMessage(); TLV tlv = container.getCurrentTLV(); // We have to handle the special case of a 0 length // mechanism if ( tlv.getLength() == 0 ) { bindRequestMessage.setSaslMechanism( "" ); } else { bindRequestMessage.setSaslMechanism( Strings.utf8ToString( tlv.getValue().getData() ) ); } // We can have an END transition container.setGrammarEndAllowed( true ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05118_THE_SASL_MECHANISM_IS, bindRequestMessage.getSaslMechanism() ) ); } } }
/** * {@inheritDoc} */ @Override public void action( LdapMessageContainer<BindRequestDecorator> container ) { BindRequest bindRequestMessage = container.getMessage(); TLV tlv = container.getCurrentTLV(); // We have to handle the special case of a 0 length // mechanism if ( tlv.getLength() == 0 ) { bindRequestMessage.setSaslMechanism( "" ); } else { bindRequestMessage.setSaslMechanism( Strings.utf8ToString( tlv.getValue().getData() ) ); } // We can have an END transition container.setGrammarEndAllowed( true ); if ( LOG.isDebugEnabled() ) { LOG.debug( I18n.msg( I18n.MSG_05118_THE_SASL_MECHANISM_IS, bindRequestMessage.getSaslMechanism() ) ); } } }
/** * Send back an AUTH-METH-NOT-SUPPORTED error message to the client */ private void sendAuthMethNotSupported( LdapSession ldapSession, BindRequest bindRequest ) { // First, r-einit the state to Anonymous, and clear the // saslProperty map ldapSession.clearSaslProperties(); ldapSession.setAnonymous(); // And send the response to the client LdapResult bindResult = bindRequest.getResultResponse().getLdapResult(); bindResult.setResultCode( ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED ); bindResult.setDiagnosticMessage( ResultCodeEnum.AUTH_METHOD_NOT_SUPPORTED.toString() + ": " + bindRequest.getSaslMechanism() + " is not a supported mechanism." ); // Write back the error ldapSession.getIoSession().write( bindRequest.getResultResponse() ); }
{ bindRequest.getSaslMechanism() }, saslRequest.getAuthorizationId(), "ldap", String message = I18n.err( I18n.ERR_04158_CANNOT_FIND_SASL_FACTORY_FOR_MECH, bindRequest.getSaslMechanism() ); LOG.error( message ); throw new LdapException( message ); bindRequestCopy.setSaslMechanism( bindRequest.getSaslMechanism() ); bindRequestCopy.setSimple( bindRequest.isSimple() ); bindRequestCopy.setVersion3( bindRequest.getVersion3() );
{ bindRequest.getSaslMechanism() }, saslRequest.getAuthorizationId(), "ldap", String message = I18n.err( I18n.ERR_04158_CANNOT_FIND_SASL_FACTORY_FOR_MECH, bindRequest.getSaslMechanism() ); LOG.error( message ); throw new LdapException( message ); bindRequestCopy.setSaslMechanism( bindRequest.getSaslMechanism() ); bindRequestCopy.setSimple( bindRequest.isSimple() ); bindRequestCopy.setVersion3( bindRequest.getVersion3() );
{ bindRequest.getSaslMechanism() }, saslRequest.getAuthorizationId(), "ldap", String message = I18n.err( I18n.ERR_04158_CANNOT_FIND_SASL_FACTORY_FOR_MECH, bindRequest.getSaslMechanism() ); LOG.error( message ); throw new LdapException( message ); bindRequestCopy.setSaslMechanism( bindRequest.getSaslMechanism() ); bindRequestCopy.setSimple( bindRequest.isSimple() ); bindRequestCopy.setVersion3( bindRequest.getVersion3() );
bindContext.setSaslMechanism( bindRequest.getSaslMechanism() );
String saslMechanism = bindRequest.getSaslMechanism();
String saslMechanism = bindRequest.getSaslMechanism(); byte[] password = null;