Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

User Password attribute does not exist???

0 views
Skip to first unread message

jacob...@hotmail.com

unread,
Oct 16, 2001, 10:00:55 AM10/16/01
to
Hi,
I am trying to verify a password versus an NDS
having LDAP enabled with the following Java file
(http://developer.novell.com/ndk/doc/samplecode/jl
dap_sample/index.htm).

************************************************
import com.novell.ldap.*;

public class VerifyPassword
{
public static void main( String[] args )
{
if (args.length != 5) {
System.out.println("Usage: java
VerifyPassword <localhost>"
+ " <login dn>
<password> <object dn>\n"
+ " <test
password>");
System.out.println("Example: java
VerifyPassword Acme.com "
+ "\"cn=Admin,o=Acme\"
secret\n"
+ "
\"cn=JSmith,ou=Sales,o=Acme\" testPassword");
System.exit(0);
}

int ldapPort =
LDAPConnection.DEFAULT_PORT;
int ldapVersion =
LDAPConnection.LDAP_V3;
String ldapHost = args[0];
String loginDN = args[1];
String password = args[2];
String objectDN = args[3];
String testPassword = args[4];
LDAPConnection lc = new LDAPConnection();

try {
// connect to the server
lc.connect( ldapHost, ldapPort );

// authenticate to the server
lc.bind( ldapVersion, loginDN,
password );

LDAPAttribute attr = new LDAPAttribute
(
"userP
assword", testPassword );
boolean correct = lc.compare(
objectDN, attr );

System.out.println( correct ? "The
password is correct.":
"The
password is incorrect.\n");

// disconnect with the server
lc.disconnect();
}
catch( LDAPException e ) {
if ( e.getLDAPResultCode() ==
LDAPException.NO_SUCH_OBJECT )
System.err.println( "Error: No
such entry" );
else if ( e.getLDAPResultCode() ==

LDAPException.NO_SUCH_ATTRIBUTE )
System.err.println( "Error: No
such attribute" );
else
System.err.println( "Error: " +
e.toString() );
}
System.exit(0);
}
}
************************************************

when I used an administrator login and password
for a bind it gave me this error ...

Error: com.novell.ldap.LDAPException: Strong
Authentication Required : (8) Strong
Authentication Required

So I used a simple bind using EMPTY admin login
and password fields. This succeeds to bind but
gives me a "No such attribute Exception"... I
thought "userPassword" was the default password
attribute that stores the users password. How
come it's not found??? Is it possible that the
password attribute has a different name? And if
so how do I find it?....

Any help would be greatly appreciated.

Thanks in advance,
Jacob.

Andy C

unread,
Oct 16, 2001, 10:05:09 AM10/16/01
to
Hi

By successfully binding to the directory you have in effect verified that
the password used in your bind method call is the same as the password
associated with the user object being used. You cannot compare the
userPassword attribute to anything because you should not/cannot see the
userPassword attribute.

Your compare method call is redundant.

Andy

<jacob...@hotmail.com> wrote in message
news:r4Xy7.2399$1v1....@prv-forum2.provo.novell.com...

jacob...@hotmail.com

unread,
Oct 16, 2001, 10:08:36 AM10/16/01
to
Hi Andy.....
I have used an empty DN and password for the
bind...without which it gives a "STRONG
AUTNETICATION ERROR".....so I have not really
verified the password.....I thought the
userPassword attribute could be verified as given
be the code of VerifyPassword.java on
http://developer.novell.com/ndk/doc/samplecode/jld
ap_sample/jldap_sample/VerifyPassword.java.html

Jacob

Jim Henderson [SysOp]

unread,
Oct 25, 2001, 12:24:01 AM10/25/01
to
Please post this question to the developer support newsgroups - these
forums are for product support. http://developer.novell.com should get
you pointed in the right direction.

Jim
--
Jim Henderson
Novell Support Connection Volunteer SysOp
http://support.novell.com/forums
(Sorry, support is not provided via e-mail)
Homepage at http://hendersj.dyndns.org (URL has changed!)

0 new messages