Examples of LdapAuthenticationException


Examples of org.apache.directory.shared.ldap.model.exception.LdapAuthenticationException

        // The password must not be empty or null
        if ( Strings.isEmpty( credentials ) && Strings.isNotEmpty( name ) )
        {
            LOG.debug( "The password is missing" );
            throw new LdapAuthenticationException( "The password is missing" );
        }
       
        // Create the BindRequest
        BindRequest bindRequest = createBindRequest( name, Strings.getBytesUtf8( credentials ) );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapAuthenticationException

        // The password must not be empty or null
        if ( Strings.isEmpty( credentials ) && Strings.isNotEmpty( name ) )
        {
            LOG.debug( "The password is missing" );
            throw new LdapAuthenticationException( "The password is missing" );
        }

        // Create the BindRequest
        BindRequest bindRequest = createBindRequest( name, Strings.getBytesUtf8( credentials ) );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapAuthenticationException

        // The password must not be empty or null
        if ( Strings.isEmpty( credentials ) && ( !Dn.EMPTY_DN.equals( name ) ) )
        {
            LOG.debug( "The password is missing" );
            throw new LdapAuthenticationException( "The password is missing" );
        }

        // Create the BindRequest
        BindRequest bindRequest = createBindRequest( name, Strings.getBytesUtf8( credentials ), null );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapAuthenticationException

        // The password must not be empty or null
        if ( Strings.isEmpty( credentials ) && (! Dn.EMPTY_DN.equals( name ) ) )
        {
            LOG.debug( "The password is missing" );
            throw new LdapAuthenticationException( "The password is missing" );
        }

        // Create the BindRequest
        BindRequest bindRequest = createBindRequest( name, Strings.getBytesUtf8( credentials ) );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapAuthenticationException

        Entry userEntry = directoryService.getPartitionNexus().lookup( lookupContext );

        if ( userEntry == null )
        {
            throw new LdapAuthenticationException( I18n.err( I18n.ERR_512, principalDn ) );
        }

        Attribute objectClass = ( ( ClonedServerEntry ) userEntry ).getOriginalEntry().get(
            SchemaConstants.OBJECT_CLASS_AT );
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapAuthenticationException

                    directoryService.getPartitionNexus().modify( bindModCtx );
                }
            }

            String upDn = ( dn == null ? "" : dn.getName() );
            throw new LdapAuthenticationException( I18n.err( I18n.ERR_229, upDn ) );
        }
        else if ( policyConfig != null )
        {
            List<Modification> mods = new ArrayList<Modification>();
View Full Code Here

Examples of org.apache.directory.shared.ldap.model.exception.LdapAuthenticationException

        else
        {
            // Bad password ...
            String message = I18n.err( I18n.ERR_230, bindContext.getDn().getName() );
            LOG.info( message );
            throw new LdapAuthenticationException( message );
        }
    }
View Full Code Here

Examples of org.apache.ldap.common.exception.LdapAuthenticationException

            {
                // authentication failed, try the next authenticator
            }
        }

        throw new LdapAuthenticationException();
    }
View Full Code Here

Examples of org.apache.ldap.common.exception.LdapAuthenticationException

        String principal;

        if ( ! ctx.getEnvironment().containsKey( Context.SECURITY_PRINCIPAL ) )
        {
            throw new LdapAuthenticationException();
        }
        else
        {
            principal = ( String ) ctx.getEnvironment().get( Context.SECURITY_PRINCIPAL );

            if ( principal == null )
            {
                throw new LdapAuthenticationException();
            }
        }

        // ---- lookup the principal entry's userPassword attribute

        LdapName principalDn = new LdapName( principal );

        PartitionNexus rootNexus = getAuthenticatorContext().getPartitionNexus();

        Attributes userEntry = rootNexus.lookup( principalDn );

        if ( userEntry == null )
        {
            throw new LdapNameNotFoundException();
        }

        Object userPassword;

        Attribute userPasswordAttr = userEntry.get( "userPassword" );

        // ---- assert that credentials match

        if ( userPasswordAttr == null )
        {
            userPassword = ArrayUtils.EMPTY_BYTE_ARRAY;
        }
        else
        {
            userPassword = userPasswordAttr.get();

            if ( userPassword instanceof String )
            {
                userPassword = ( ( String ) userPassword ).getBytes();
            }
        }

        if ( ! ArrayUtils.isEquals( creds, userPassword ) )
        {
            throw new LdapAuthenticationException();
        }

        return new LdapPrincipal( principalDn );
    }
View Full Code Here

Examples of org.apache.ldap.common.exception.LdapAuthenticationException

                // Log other exceptions than LdapAuthenticationException
                log.warn( "Unexpected exception from " + authenticator.getClass(), e );
            }
        }

        throw new LdapAuthenticationException();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.