1 17 package org.alfresco.repo.security.authentication; 18 19 20 32 public class SimpleAcceptOrRejectAllAuthenticationComponentImpl extends AbstractAuthenticationComponent 33 { 34 private boolean accept = false; 35 36 public SimpleAcceptOrRejectAllAuthenticationComponentImpl() 37 { 38 super(); 39 } 40 41 public void setAccept(boolean accept) 42 { 43 this.accept = accept; 44 } 45 46 public void authenticate(String userName, char[] password) throws AuthenticationException 47 { 48 if(accept) 49 { 50 setCurrentUser(userName); 51 } 52 else 53 { 54 throw new AuthenticationException("Access Denied"); 55 } 56 57 } 58 59 @Override 60 protected boolean implementationAllowsGuestLogin() 61 { 62 return accept; 63 } 64 65 66 } 67 | Popular Tags |