congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
MemoryRealm
Code IndexAdd Tabnine to your IDE (free)

How to use
MemoryRealm
in
org.apache.catalina.realm

Best Java code snippets using org.apache.catalina.realm.MemoryRealm (Showing top 20 results out of 315)

origin: stackoverflow.com

container.setRealm(new MemoryRealm());
origin: tomcat/catalina

/**
 * 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;
  }   
}
origin: com.ovea.tajin.server/tajin-server-jetty9

  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");
origin: apache/tomcat-maven-plugin

MemoryRealm memoryRealm = new MemoryRealm();
  memoryRealm.setPathname( tomcatUsers.getAbsolutePath() );
origin: tomcat/catalina-optional

if (hasMessageDigest()) {
  validated = (digest(credentials)
         .equalsIgnoreCase(principal.getPassword()));
} else {
  validated =
    (digest(credentials).equals(principal.getPassword()));
origin: org.apache.tomcat/tomcat-catalina

/**
 * Process a <code>&lt;user&gt;</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);
}
origin: tomcat/catalina-optional

  log.debug(sm.getString("memoryRealm.loadPath",
           file.getAbsolutePath()));
Digester digester = getDigester();
try {
  synchronized (digester) {
origin: org.ops4j.pax.tipi/org.ops4j.pax.tipi.tomcat-embed-core

String pathName = getPathname();
try (InputStream is = ConfigFileLoader.getInputStream(pathName)) {
  Digester digester = getDigester();
  try {
    synchronized (digester) {
origin: tomcat/catalina-optional

principal = super.authenticate(username, password);
origin: codefollower/Tomcat-Research

  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) {
origin: com.ovea.tajin.server/tajin-server-jetty9

/**
 * 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;
  }   
}
origin: codefollower/Tomcat-Research

  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");
origin: apache/tomcat-maven-plugin

MemoryRealm memoryRealm = new MemoryRealm();
  memoryRealm.setPathname( tomcatUsers.getAbsolutePath() );
origin: org.apache.catalina/com.springsource.org.apache.catalina

if (hasMessageDigest()) {
  validated = (digest(credentials)
         .equalsIgnoreCase(principal.getPassword()));
} else {
  validated =
    (digest(credentials).equals(principal.getPassword()));
origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Process a <code>&lt;user&gt;</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);
}
origin: org.apache.geronimo.ext.tomcat/catalina

  log.debug(sm.getString("memoryRealm.loadPath",
           file.getAbsolutePath()));
Digester digester = getDigester();
try {
  synchronized (digester) {
origin: org.apache.tomcat/tomcat-catalina

String pathName = getPathname();
try (InputStream is = ConfigFileLoader.getSource().getResource(pathName).getInputStream()) {
  Digester digester = getDigester();
  try {
    synchronized (digester) {
origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * 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;
  }   
}
origin: org.apache.catalina/com.springsource.org.apache.catalina

  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");
origin: apache/tomcat-maven-plugin

MemoryRealm memoryRealm = new MemoryRealm();
  memoryRealm.setPathname( tomcatUsers.getAbsolutePath() );
org.apache.catalina.realmMemoryRealm

Javadoc

Simple implementation of Realm that reads an XML file to configure the valid users, passwords, and roles. The file format (and default file location) are identical to those currently supported by Tomcat 3.X.

IMPLEMENTATION NOTE: It is assumed that the in-memory collection representing our defined users (and their roles) is initialized at application startup and never modified again. Therefore, no thread synchronization is performed around accesses to the principals collection.

Most used methods

  • <init>
  • addUser
    Add a new user to the in-memory database.
  • authenticate
  • getDigester
  • getPrincipal
  • getObjectName
  • digest
  • hasMessageDigest
  • setPathname
    Set the pathname of our XML file containing user definitions. If a relative pathname is specified, i
  • getCredentialHandler
  • getPathname
  • compareCredentials
  • getPathname,
  • compareCredentials,
  • getContainer

Popular in Java

  • Finding current android device location
  • runOnUiThread (Activity)
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • BufferedReader (java.io)
    Wraps an existing Reader and buffers the input. Expensive interaction with the underlying reader is
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top Sublime Text plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now