Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.tomcat.modules.aaa
Class SimpleRealm

    java.lang.Object
      org.apache.tomcat.core.BaseInterceptor
          org.apache.tomcat.modules.aaa.RealmBase
              org.apache.tomcat.modules.aaa.SimpleRealm

public class SimpleRealm
extends RealmBase

Memory based realm - will authenticate an user and password against an xml file. The file is fully read in memory when the context is initialized. The default file is TOMCAT_HOME/conf/users/tomcat-users.xml. You can change it, and you can also set this module as a per context interceptor, so that each module have it's own realm. The module will use "credentials.user" and "credentials.password" request notes. It's role is to verify those notes, other module is specialized in extracting the information from the request.

Nested Class Summary
`static class` | `SimpleRealm.SimpleRealmPrincipal`

Field Summary

Fields inherited from class org.apache.tomcat.modules.aaa.RealmBase
`digest, sm`

Fields inherited from class org.apache.tomcat.core.BaseInterceptor
`cm, ct, ctx, debug, DECLINED, loghelper, OK`

Constructor Summary
`SimpleRealm()`

Method Summary
`void` | `contextInit(Context ctx)` Notify when a context is initialized.
`protected java.lang.String` | `getCredentials(java.lang.String username)` getCredentials
`java.lang.String` | `getFilename()`
`protected java.security.Principal` | `getPrincipal(java.lang.String username)` getPrincipal
`protected java.lang.String[]` | `getUserRoles(java.lang.String username)` getUserRoles
`void` | `setFilename(java.lang.String newFilename)`

Methods inherited from class org.apache.tomcat.modules.aaa.RealmBase
`authenticate, digest, engineInit, getDigest, main, setDigest`

Methods inherited from class org.apache.tomcat.core.BaseInterceptor
`addContainer, addContext, addHandler, addInterceptor, addSecurityConstraint, afterBody, authorize, beforeBody, beforeCommit, contextMap, contextShutdown, contextState, copyContext, engineShutdown, engineStart, engineState, engineStop, findSession, getContext, getContextManager, getDebug, getInfo, getLog, getNote, getNote, handleError, log, log, log, log, postInitCheck, postReadRequest, postRequest, postService, postServletDestroy, postServletInit, preInitCheck, preService, preServletDestroy, preServletInit, registerHooks, reload, removeContainer, removeContext, removeHandler, removeInterceptor, requestMap, sessionState, setContext, setContextManager, setDebug, setInfo, setNote, setNote`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SimpleRealm

    public SimpleRealm()

Method Detail

### getFilename

    public java.lang.String getFilename()

### setFilename

    public void setFilename(java.lang.String newFilename)

### contextInit

    public void contextInit(Context ctx)
                     throws TomcatException

  Description copied from class: `BaseInterceptor`
  Notify when a context is initialized. The first interceptor in the chain for contextInit must read web.xml and set the context. When this method is called you can expect the context to be filled in with all the informations from web.xml.

  Overrides:
    `contextInit` in class `BaseInterceptor`
  Throws:
    `TomcatException`

### getPrincipal

    protected java.security.Principal getPrincipal(java.lang.String username)

  getPrincipal

  Specified by:
    `getPrincipal` in class `RealmBase`
  Parameters:
    `username` -
  Returns:
    java.security.Principal

### getCredentials

    protected java.lang.String getCredentials(java.lang.String username)

  getCredentials

  Specified by:
    `getCredentials` in class `RealmBase`
  Parameters:
    `username` -
  Returns:
    java.lang.String

### getUserRoles

    protected java.lang.String[] getUserRoles(java.lang.String username)

  getUserRoles

  Specified by:
    `getUserRoles` in class `RealmBase`
  Parameters:
    `username` -
  Returns:
    java.lang.String

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001 Apache Software Foundation. All Rights Reserved.