Tabnine Logo
org.apache.catalina.realm
Code IndexAdd Tabnine to your IDE (free)

How to use org.apache.catalina.realm

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

origin: OryxProject/oryx

@Override
protected String getPassword(String username) {
 GenericPrincipal principal = principals.get(username);
 return principal == null ? null : principal.getPassword();
}
origin: OryxProject/oryx

void addUser(String username, String password) {
 principals.put(username, new GenericPrincipal(username, password, Collections.singletonList(AUTH_ROLE)));
}
origin: line/armeria

realm = new NullRealm();
origin: org.apache.tomcat/tomcat-catalina

/**
 * Get the principal associated with the specified user.
 * @param username The user name
 * @return the Principal associated with the given user name.
 */
@Override
protected synchronized Principal getPrincipal(String username) {
  return new GenericPrincipal(username,
                 getPassword(username),
                 getRoles(username));
}
origin: tomcat/catalina-optional

/**
 * Return the Principal associated with the given user name.
 */
protected synchronized Principal getPrincipal(DirContext context,
                       String username)
  throws NamingException {
  
  User user = getUser(context, username);
  
  return new GenericPrincipal(this, user.username, user.password ,
      getRoles(context, user));
}
origin: org.apache.tomcat/tomcat-catalina

/**
 * @return the <code>Principal</code> associated with the given user name.
 */
@Override
protected Principal getPrincipal(String username) {
  return authenticate(username,
      new JAASCallbackHandler(this, username, null, null, null, null,
          null, null, null, HttpServletRequest.CLIENT_CERT_AUTH));
}
origin: org.apache.tomcat/tomcat-catalina

protected Principal getPrincipal(String username,
    GSSCredential gssCredential) {
  Principal p = getPrincipal(username);
  if (p instanceof GenericPrincipal) {
    ((GenericPrincipal) p).setGssCredential(gssCredential);
  }
  return p;
}
origin: apache/geode

container.setCatalinaHome(catalinaHome);
container.setRealm(new MemoryRealm());
origin: tomcat/catalina-optional

/**
 * Gracefully shut down active use of the public methods of this Component.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that needs to be reported
 */
public void stop() throws LifecycleException {
  // Perform normal superclass finalization
  super.stop();
  // Close any open DB connection
  close(this.dbConnection);
}
origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Return the Principal associated with the given user name.
 */
@Override
protected synchronized Principal getPrincipal(String username) {
  return (new GenericPrincipal(username,
                 getPassword(username),
                 getRoles(username)));
}
origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Return the <code>Principal</code> associated with the given user name.
 */
@Override
protected Principal getPrincipal(String username) {
  return authenticate(username,
      new JAASCallbackHandler(this, username, null, null, null, null,
          null, null, null, HttpServletRequest.CLIENT_CERT_AUTH));
}
origin: codefollower/Tomcat-Research

protected Principal getPrincipal(String username,
    GSSCredential gssCredential) {
  Principal p = getPrincipal(username);
  if (p instanceof GenericPrincipal) {
    ((GenericPrincipal) p).setGssCredential(gssCredential);
  }
  return p;
}
origin: OryxProject/oryx

@Override
public Principal authenticate(String username, String credentials) {
 GenericPrincipal principal = principals.get(username);
 boolean validated = principal != null && getCredentialHandler().matches(credentials, principal.getPassword());
 return validated ? principal : null;
}
origin: stackoverflow.com

container.setRealm(new MemoryRealm());
origin: line/armeria

/**
 * Returns the {@link Engine} of the specified Tomcat {@link Service}. If the {@link Service} has no
 * {@link Engine} set, a new {@link Engine} will be created and set.
 *
 * <p>The return type of {@link Service#getContainer()} has been changed from {@link Container} to
 * {@link Engine} since 8.5. Calling it directly will cause {@link NoSuchMethodError}.
 */
static Engine engine(Service service, String hostname) {
  final Engine engine;
  try {
    final Method m = Service.class.getDeclaredMethod("getContainer");
    engine = (Engine) m.invoke(service);
  } catch (Exception e) {
    throw new Error("failed to invoke Service.getContainer()", e);
  }
  if (engine != null) {
    return engine;
  }
  // Create a new engine.
  final Engine newEngine = new StandardEngine();
  newEngine.setName("Tomcat");
  newEngine.setDefaultHost(hostname);
  newEngine.setRealm(new NullRealm());
  service.setContainer(newEngine);
  return newEngine;
}
origin: org.apache.catalina/com.springsource.org.apache.catalina

/**
 * Return the Principal associated with the given user name.
 */
@Override
protected synchronized Principal getPrincipal(String username) {
  return (new GenericPrincipal(username,
                 getPassword(username),
                 getRoles(username)));
}
origin: com.ovea.tajin.servers/tajin-server-jetty9

/**
 * Return the <code>Principal</code> associated with the given user name.
 */
@Override
protected Principal getPrincipal(String username) {
  return authenticate(username,
      new JAASCallbackHandler(this, username, null, null, null, null,
          null, null, null, Constants.CERT_METHOD));
}
origin: org.apache.geronimo.ext.tomcat/catalina

protected Principal getPrincipal(String username,
    GSSCredential gssCredential) {
  Principal p = getPrincipal(username);
  
  if (p instanceof GenericPrincipal) {
    ((GenericPrincipal) p).setGssCredential(gssCredential);
  }
  
  return p;
}
origin: codefollower/Tomcat-Research

/**
 * Return the Principal associated with the given user name.
 */
@Override
protected synchronized Principal getPrincipal(String username) {
  return (new GenericPrincipal(username,
                 getPassword(username),
                 getRoles(username)));
}
origin: codefollower/Tomcat-Research

/**
 * Return the <code>Principal</code> associated with the given user name.
 */
@Override
protected Principal getPrincipal(String username) {
  return authenticate(username,
      new JAASCallbackHandler(this, username, null, null, null, null,
          null, null, null, HttpServletRequest.CLIENT_CERT_AUTH));
}
org.apache.catalina.realm

Most used classes

  • GenericPrincipal
    Generic implementation of java.security.Principal that is available for use by Realm implementation
  • RealmBase
    Simple implementation of Realm that reads an XML file to configure the valid users, passwords, and r
  • MemoryRealm
    Simple implementation of Realm that reads an XML file to configure the valid users, passwords, and r
  • JAASRealm
    Implmentation of Realm that authenticates users via the Java Authentication and Authorization Servic
  • JAASCallbackHandler
    Implementation of the JAAS CallbackHandler interface, used to negotiate delivery of the username and
  • RealmBase$AllRolesMode,
  • CombinedRealm,
  • DataSourceRealm,
  • JDBCRealm,
  • UserDatabaseRealm,
  • JAASMemoryLoginModule,
  • MemoryRuleSet,
  • MemoryUserRule,
  • JNDIRealm$User,
  • LockOutRealm$1,
  • LockOutRealm$LockRecord,
  • LockOutRealm,
  • NullRealm,
  • X509SubjectDnRetriever
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