/** * @see Object#toString() */ public String toString() { return "BindContext for Dn '" + getDn().getName() + "', credentials <" + ( credentials != null ? Strings.dumpBytes( credentials ) : "" ) + ">" + ( saslMechanism != null ? ", saslMechanism : <" + saslMechanism + ">" : "" ) + ( saslAuthId != null ? ", saslAuthId <" + saslAuthId + ">" : "" ); }
LOG.debug( "Authenticating {}", bindContext.getDn() ); LOG.debug( "{} Authentication failed: {}", bindContext.getDn(), ppe.getMessage() ); throw ppe; LOG.debug( "{} Authenticated", bindContext.getDn() ); String message = I18n.err( I18n.ERR_230, bindContext.getDn().getName() ); LOG.info( message ); throw new LdapAuthenticationException( message );
principal = ( LdapPrincipal ) credentialCache.get( bindContext.getDn() ); principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindContext.getDn(), AuthenticationLevel.SIMPLE ); principal.setUserPassword( storedPasswords ); credentialCache.put( bindContext.getDn().getNormName(), principal );
/** * User has already been authenticated during SASL negotiation. Set the authentication level * to strong and return an {@link LdapPrincipal}. */ @Override public LdapPrincipal authenticate( BindOperationContext bindContext ) throws LdapAuthenticationException { // Possibly check if user account is disabled, other account checks. LdapPrincipal principal = new LdapPrincipal( getDirectoryService().getSchemaManager(), bindContext.getDn(), AuthenticationLevel.STRONG ); IoSession session = bindContext.getIoSession(); if ( session != null ) { SocketAddress clientAddress = session.getRemoteAddress(); principal.setClientAddress( clientAddress ); SocketAddress serverAddress = session.getServiceAddress(); principal.setServerAddress( serverAddress ); } return principal; } }