1 17 package org.apache.ldap.server.authn; 18 19 import org.apache.ldap.common.exception.LdapNoPermissionException; 20 import org.apache.ldap.server.jndi.ServerContext; 21 22 import javax.naming.NamingException ; 23 24 29 public class AnonymousAuthenticator extends AbstractAuthenticator 30 { 31 public AnonymousAuthenticator( ) 32 { 33 super( "none" ); 34 } 35 36 37 41 public LdapPrincipal authenticate( ServerContext ctx ) throws NamingException 42 { 43 if ( getAuthenticatorContext().getAllowAnonymous() ) 44 { 45 return LdapPrincipal.ANONYMOUS ; 46 } 47 else 48 { 49 throw new LdapNoPermissionException( "Anonymous bind NOT permitted!" ); 50 } 51 } 52 } 53 | Popular Tags |