1 19 20 package com.sslexplorer.agent; 21 22 import java.util.ArrayList ; 23 import java.util.Collection ; 24 25 import com.sslexplorer.boot.RequestHandlerRequest; 26 import com.sslexplorer.security.User; 27 28 32 public abstract class AbstractAgentCallback implements AgentCallback { 33 private final Collection <AgentAuthenticator> authenticators_ = new ArrayList <AgentAuthenticator>(); 34 35 39 public void registerAuthenticator(AgentAuthenticator agentAuthenticator) { 40 authenticators_.add(agentAuthenticator); 41 } 42 43 public User authenticate(RequestHandlerRequest request) { 44 for (AgentAuthenticator authenticator : authenticators_) { 45 User user = authenticator.authenticate(request); 46 if (null != user) { 47 return user; 48 } 49 } 50 return null; 51 } 52 } | Popular Tags |