container.setRealm(new MemoryRealm());
/** * Create a new Memory Realm. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered */ public String createMemoryRealm(String parent) throws Exception { // Create a new MemoryRealm instance MemoryRealm realm = new MemoryRealm(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); // Add the new instance to its parent component containerBase.setRealm(realm); // Return the corresponding MBean name ObjectName oname = realm.getObjectName(); if (oname != null) { return (oname.toString()); } else { return null; } }
principal = super.authenticate(username, password); } else if (authMethod.equals(Constants.DIGEST_METHOD)) { principal = super.authenticate(username, password, nonce, nc, cnonce, qop, realmName, md5a2); } else if (authMethod.equals(Constants.CERT_METHOD)) { principal = super.getPrincipal(username); } else { throw new LoginException("Unknown authentication method");
MemoryRealm memoryRealm = new MemoryRealm(); memoryRealm.setPathname( tomcatUsers.getAbsolutePath() );
if (hasMessageDigest()) { validated = (digest(credentials) .equalsIgnoreCase(principal.getPassword())); } else { validated = (digest(credentials).equals(principal.getPassword()));
/** * Process a <code><user></code> element from the XML database file. * * @param attributes The attribute list for this element */ @Override public void begin(String namespace, String name, Attributes attributes) throws Exception { String username = attributes.getValue("username"); if (username == null) { username = attributes.getValue("name"); } String password = attributes.getValue("password"); String roles = attributes.getValue("roles"); MemoryRealm realm = (MemoryRealm) digester.peek(digester.getCount() - 1); realm.addUser(username, password, roles); }
log.debug(sm.getString("memoryRealm.loadPath", file.getAbsolutePath())); Digester digester = getDigester(); try { synchronized (digester) {
String pathName = getPathname(); try (InputStream is = ConfigFileLoader.getInputStream(pathName)) { Digester digester = getDigester(); try { synchronized (digester) {
principal = super.authenticate(username, password);
file = new File(getContainer().getCatalinaBase(), pathname); if (!file.exists() || !file.canRead()) throw new LifecycleException log.debug(sm.getString("memoryRealm.loadPath", file.getAbsolutePath())); Digester digester = getDigester(); try { synchronized (digester) {
/** * Create a new Memory Realm. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered */ public String createMemoryRealm(String parent) throws Exception { // Create a new MemoryRealm instance MemoryRealm realm = new MemoryRealm(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); // Add the new instance to its parent component containerBase.setRealm(realm); // Return the corresponding MBean name ObjectName oname = realm.getObjectName(); if (oname != null) { return (oname.toString()); } else { return null; } }
principal = super.authenticate(username, password); } else if (authMethod.equals(HttpServletRequest.DIGEST_AUTH)) { principal = super.authenticate(username, password, nonce, nc, cnonce, qop, realmName, md5a2); } else if (authMethod.equals(HttpServletRequest.CLIENT_CERT_AUTH)) { principal = super.getPrincipal(username); } else { throw new LoginException("Unknown authentication method");
MemoryRealm memoryRealm = new MemoryRealm(); memoryRealm.setPathname( tomcatUsers.getAbsolutePath() );
if (hasMessageDigest()) { validated = (digest(credentials) .equalsIgnoreCase(principal.getPassword())); } else { validated = (digest(credentials).equals(principal.getPassword()));
/** * Process a <code><user></code> element from the XML database file. * * @param attributes The attribute list for this element */ @Override public void begin(String namespace, String name, Attributes attributes) throws Exception { String username = attributes.getValue("name"); if (username == null) { username = attributes.getValue("username"); } String password = attributes.getValue("password"); String roles = attributes.getValue("roles"); MemoryRealm realm = (MemoryRealm) digester.peek(digester.getCount() - 1); realm.addUser(username, password, roles); }
log.debug(sm.getString("memoryRealm.loadPath", file.getAbsolutePath())); Digester digester = getDigester(); try { synchronized (digester) {
String pathName = getPathname(); try (InputStream is = ConfigFileLoader.getSource().getResource(pathName).getInputStream()) { Digester digester = getDigester(); try { synchronized (digester) {
/** * Create a new Memory Realm. * * @param parent MBean Name of the associated parent component * * @exception Exception if an MBean cannot be created or registered */ public String createMemoryRealm(String parent) throws Exception { // Create a new MemoryRealm instance MemoryRealm realm = new MemoryRealm(); // Add the new instance to its parent component ObjectName pname = new ObjectName(parent); ContainerBase containerBase = getParentContainerFromParent(pname); // Add the new instance to its parent component containerBase.setRealm(realm); // Return the corresponding MBean name ObjectName oname = realm.getObjectName(); if (oname != null) { return (oname.toString()); } else { return null; } }
principal = super.authenticate(username, password); } else if (authMethod.equals(HttpServletRequest.DIGEST_AUTH)) { principal = super.authenticate(username, password, nonce, nc, cnonce, qop, realmName, md5a2); } else if (authMethod.equals(HttpServletRequest.CLIENT_CERT_AUTH)) { principal = super.getPrincipal(username); } else { throw new LoginException("Unknown authentication method");
MemoryRealm memoryRealm = new MemoryRealm(); memoryRealm.setPathname( tomcatUsers.getAbsolutePath() );