directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <elecha...@gmail.com>
Subject Connection and authentication knowledge
Date Tue, 23 Feb 2010 16:20:05 GMT
Hi,

should we add some method in LdapConnection to inform the user about the 
authentication ?

ie, isAnonymous(), isSimpleAuth(), isSaslAuth(), or even better 
getAuthenticatedUser() returning the principal ?

// Anonymous connection
connection.bind();

if ( connection.isAnonymous() ) {
   System.out.println( "anonymous" );
}

// Authenticated connection
connection.bind( "uid=admin,ou=system", "secret" );

if ( connection.isAnonymous() ) {
   System.out.println( "anonymous" );
} else if ( connection.isSimpleAuth() ) {
   System.out.println( "SimpleAuth for : " + 
connection.getAuthenticatedUser() );
}

wdyt ?

-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.nextury.com



Mime
View raw message