Package javax.naming.directory

Examples of javax.naming.directory.ModificationItem


        assertTrue( attrs.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using SHA
        Attribute userPasswordAttribute = new BasicAttribute( "userPassword", "{SHA}5en6G6MezRroT3XKqkdPOmY/BfQ=" );
        ctx.modifyAttributes( "", new ModificationItem[] {
            new ModificationItem( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute ) } );

        // close and try with old password (should fail)
        ctx.close();

        try
View Full Code Here


        assertTrue( attrs.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using SHA
        BasicAttribute userPasswordAttribute = new BasicAttribute( "userPassword", "{SSHA}mjVVxasFkk59wMW4L1Ldt+YCblfhULHs03WW7g==" );
        ctx.modifyAttributes( "", new ModificationItem[] {
            new ModificationItem( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute ) } );

        // close and try with old password (should fail)
        ctx.close();

        try
View Full Code Here

        assertTrue( attrs.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'test123', encrypted using SHA with a 4 bytes salt
        BasicAttribute userPasswordAttribute = new BasicAttribute( "userPassword", "{SSHA}0TT388zsWzHKtMEpIU/8/W68egchNEWp" );
        ctx.modifyAttributes( "", new ModificationItem[] {
            new ModificationItem( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute ) } );

        // close and try with old password (should fail)
        ctx.close();

        try
View Full Code Here

        assertTrue( attrs.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using MD5
        Attribute userPasswordAttribute = new BasicAttribute( "userPassword", "{MD5}Xr4ilOzQ4PCOq3aQ0qbuaQ==" );
        ctx.modifyAttributes( "", new ModificationItem[] {
            new ModificationItem( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute ) } );

        // close and try with old password (should fail)
        ctx.close();

        try
View Full Code Here

        assertTrue( attrs.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using SMD5
        Attribute userPasswordAttribute = new BasicAttribute( "userPassword", "{SMD5}tQ9wo/VBuKsqBtylMMCcORbnYOJFMyDJ" );
        ctx.modifyAttributes( "", new ModificationItem[] {
            new ModificationItem( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute ) } );

        // close and try with old password (should fail)
        ctx.close();

        try
View Full Code Here

        assertTrue( attrs.get( "uid" ).contains( "akarasulu" ) );

        // now modify the password for akarasulu : 'secret', encrypted using CRYPT
        Attribute userPasswordAttribute = new BasicAttribute( "userPassword", "{crypt}qFkH8Z1woBlXw" );
        ctx.modifyAttributes( "", new ModificationItem[] {
            new ModificationItem( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute ) } );

        // close and try with old password (should fail)
        ctx.close();

        try
View Full Code Here

            service.getSession( new DN( userDn ), "secret".getBytes() ), new DN( userDn ) );

        // now modify the password for akarasulu (while we're admin)
        Attribute userPasswordAttribute = new BasicAttribute( "userPassword", "newpwd" );
        ctx.modifyAttributes( "", new ModificationItem[] {
            new ModificationItem( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute ) } );
        ctx.close();

        try
        {
            ctx = new ServerLdapContext( service,
View Full Code Here

        DN dn = getSyntaxCheckerContainer( "apachemeta" );
        dn.add( "m-oid" + "=" + OID );
       
        ModificationItem[] mods = new ModificationItem[1];
        Attribute attr = new BasicAttribute( "m-fqcn", BogusSyntaxChecker.class.getName() );
        mods[0] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr );
        getSchemaContext( service ).modifyAttributes( dn, mods );

        assertTrue( "syntaxChecker OID should still be present",
            schemaManager.getSyntaxCheckerRegistry().contains( OID ) );
       
View Full Code Here

        // if krb5kdc is disabled then enable it
        if ( isKrb5KdcDisabled )
        {
            Attribute disabled = new BasicAttribute( "m-disabled" );
            ModificationItem[] mods = new ModificationItem[]
                { new ModificationItem( DirContext.REMOVE_ATTRIBUTE, disabled ) };
            schemaRoot.modifyAttributes( "cn=Krb5kdc", mods );
        }

        // Get a context, create the ou=users subcontext, then create the 3 principals.
        Hashtable<String, Object> env = new Hashtable<String, Object>();
View Full Code Here

        {
            if ( this.securityCredentials.equals( oldPassword ) )
            {
                ModificationItem[] mods = new ModificationItem[1];
                Attribute password = new BasicAttribute( "userpassword", newPassword );
                mods[0] = new ModificationItem( DirContext.REPLACE_ATTRIBUTE, password );

                try
                {
                    DirContext dc = openDirContext();
View Full Code Here

TOP

Related Classes of javax.naming.directory.ModificationItem

Copyright © 2018 www.massapicom. 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.