org.apache.catalina.realm

Class CombinedRealm

public class CombinedRealm extends RealmBase

Realm implementation that contains one or more realms. Authentication is attempted for each realm in the order they were configured. If any realm authenticates the user then the authentication succeeds. When combining realms usernames should be unique across all combined realms.
Field Summary
protected List<Realm>realms
The list of Realms contained by this Realm.
protected static StringManagersm
The string manager for this package.
Method Summary
voidaddRealm(Realm theRealm)
Add a realm to the list of realms that will be used to authenticate users.
Principalauthenticate(String username, byte[] credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
Principalauthenticate(String username, String clientDigest, String once, String nc, String cnonce, String qop, String realmName, String md5a2)
Return the Principal associated with the specified username, which matches the digest calculated using the given parameters using the method described in RFC 2069; otherwise return null.
Principalauthenticate(String username, String credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null.
Principalauthenticate(X509Certificate[] certs)
Return the Principal associated with the specified chain of X509 client certificates.
ObjectName[]getRealms()
Return the set of Realms that this Realm is wrapping
voidsetContainer(Container container)
Set the Container with which this Realm has been associated.
voidstart()
Prepare for the beginning of active use of the public methods of this component.
voidstop()
Gracefully terminate the active use of the public methods of this component.

Field Detail

realms

protected List<Realm> realms
The list of Realms contained by this Realm.

sm

protected static StringManager sm
The string manager for this package.

Method Detail

addRealm

public void addRealm(Realm theRealm)
Add a realm to the list of realms that will be used to authenticate users.

authenticate

public Principal authenticate(String username, byte[] 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

authenticate

public Principal authenticate(String username, String clientDigest, String once, String nc, String cnonce, String qop, String realmName, String md5a2)
Return the Principal associated with the specified username, which matches the digest calculated using the given parameters using the method described in RFC 2069; otherwise return null.

Parameters: username Username of the Principal to look up clientDigest Digest which has been submitted by the client nOnce Unique (or supposedly unique) token which has been used for this request realm Realm name md5a2 Second MD5 digest used to calculate the digest : MD5(Method + ":" + uri)

authenticate

public Principal authenticate(String username, 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

authenticate

public Principal authenticate(X509Certificate[] certs)
Return the Principal associated with the specified chain of X509 client certificates. If there is none, return null.

Parameters: certs Array of client certificates, with the first one in the array being the certificate of the client itself.

getRealms

public ObjectName[] getRealms()
Return the set of Realms that this Realm is wrapping

setContainer

public void setContainer(Container container)
Set the Container with which this Realm has been associated.

Parameters: container The associated Container

start

public void start()
Prepare for the beginning of active use of the public methods of this component. This method should be called before any of the public methods of this component are utilized. It should also send a LifecycleEvent of type START_EVENT to any registered listeners.

Throws: LifecycleException if this component detects a fatal error that prevents this component from being used

stop

public void stop()
Gracefully terminate the active use of the public methods of this component. This method should be the last one called on a given instance of this component. It should also send a LifecycleEvent of type STOP_EVENT to any registered listeners.

Throws: LifecycleException if this component detects a fatal error that needs to be reported

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.