| 1 18 19 package org.apache.activemq.jaas; 20 21 import java.security.cert.X509Certificate ; 22 import java.util.Set ; 23 24 import javax.security.auth.login.LoginException ; 25 26 public class StubCertificateLoginModule extends CertificateLoginModule { 27 final String userName; 28 final Set groupNames; 29 30 String lastUserName = null; 31 X509Certificate [] lastCertChain = null; 32 33 public StubCertificateLoginModule(String userName, Set groupNames) { 34 this.userName = userName; 35 this.groupNames = groupNames; 36 } 37 38 protected String getUserNameForCertificates(X509Certificate [] certs) 39 throws LoginException { 40 lastCertChain = certs; 41 return userName; 42 } 43 44 protected Set getUserGroups(String username) throws LoginException { 45 lastUserName = username; 46 return this.groupNames; 47 } 48 } 49 | Popular Tags |