as PAM said in another mail, it would be good, but am afraid we need
to maintain a bunch of flags to just support this feature.
I don't think this is widely used unless a user manages many
connections.
Kiran Ayyagari
On 2/23/10 6:20 PM, Emmanuel Lecharny wrote:
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 ?