org.objectweb.security.tomcat.interceptor
Class SecurityCtxInterceptor40

org.objectweb.security.tomcat.interceptor.SecurityCtxInterceptor40

public final class SecurityCtxInterceptor40

this class is used as security interceptor for tomcat 4.0.x for propagating security context The original code came from org/apache/catalina/realm/MemoryRealm the only difference is in authenticate method where a JOnAS Security context is associated to the current thread

Author:
Craig R. McClanahan Contributor: PhCoq

Field Summary
protected  java.lang.String info
          Descriptive information about this Realm implementation.
protected static java.lang.String name
          Descriptive information about this Realm implementation.
 
Constructor Summary
SecurityCtxInterceptor40()
           
 
Method Summary
 java.security.Principal authenticate(java.lang.String username, java.lang.String credentials)
          Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
 java.lang.String getInfo()
          Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version>.
protected  java.lang.String getName()
          Return a short name for this Realm implementation.
protected  java.lang.String getPassword(java.lang.String username)
          Return the password associated with the given principal's user name.
 java.lang.String getPathname()
          Return the pathname of our XML file containing user definitions.
protected  java.security.Principal getPrincipal(java.lang.String username)
          Return the Principal associated with the given user name.
 void setPathname(java.lang.String pathname)
          Set the pathname of our XML file containing user definitions.
 void start()
          Prepare for active use of the public methods of this Component.
 void stop()
          Gracefully shut down active use of the public methods of this Component.
 

Field Detail

info

protected final java.lang.String info
Descriptive information about this Realm implementation.

name

protected static final java.lang.String name
Descriptive information about this Realm implementation.
Constructor Detail

SecurityCtxInterceptor40

public SecurityCtxInterceptor40()
Method Detail

getInfo

public java.lang.String getInfo()
Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version>.

getPathname

public java.lang.String getPathname()
Return the pathname of our XML file containing user definitions.

setPathname

public void setPathname(java.lang.String pathname)
Set the pathname of our XML file containing user definitions. If a relative pathname is specified, it is resolved against "catalina.base".
Parameters:
pathname - The new pathname

authenticate

public java.security.Principal authenticate(java.lang.String username,
                                            java.lang.String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
Parameters:
username - Username of the Principal to look up
credentials - Password or other credentials to use in authenticating this username

getName

protected java.lang.String getName()
Return a short name for this Realm implementation.

getPassword

protected java.lang.String getPassword(java.lang.String username)
Return the password associated with the given principal's user name.

getPrincipal

protected java.security.Principal getPrincipal(java.lang.String username)
Return the Principal associated with the given user name.

start

public void start()
           throws org.apache.catalina.LifecycleException
Prepare for active use of the public methods of this Component.
Throws:
java.lang.IllegalStateException - if this component has already been started
LifecycleException - if this component detects a fatal error that prevents it from being started

stop

public void stop()
          throws org.apache.catalina.LifecycleException
Gracefully shut down active use of the public methods of this Component.
Throws:
java.lang.IllegalStateException - if this component has not been started
LifecycleException - if this component detects a fatal error that needs to be reported