|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Realm
A Realm is a read-only facade for an underlying security realm used to authenticate individual users, and identify the security roles associated with those users. Realms can be attached at any Container level, but will typically only be attached to a Context, or higher level, Container.
Method Summary | |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Add a property change listener to this component. |
java.security.Principal |
authenticate(java.lang.String username,
byte[] credentials)
Return the Principal associated with the specified username and credentials, if there is one; otherwise return null . |
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.security.Principal |
authenticate(java.lang.String username,
java.lang.String digest,
java.lang.String nonce,
java.lang.String nc,
java.lang.String cnonce,
java.lang.String qop,
java.lang.String realm,
java.lang.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 . |
java.security.Principal |
authenticate(java.security.cert.X509Certificate[] certs)
Return the Principal associated with the specified chain of X509 client certificates. |
void |
backgroundProcess()
Execute a periodic task, such as reloading, etc. |
SecurityConstraint[] |
findSecurityConstraints(Request request,
Context context)
Return the SecurityConstraints configured to guard the request URI for this request, or null if there is no such constraint. |
Container |
getContainer()
Return the Container with which this Realm has been associated. |
java.lang.String |
getInfo()
Return descriptive information about this Realm implementation and the corresponding version number, in the format <description>/<version> . |
boolean |
hasResourcePermission(Request request,
Response response,
SecurityConstraint[] constraint,
Context context)
Perform access control based on the specified authorization constraint. |
boolean |
hasRole(java.security.Principal principal,
java.lang.String role)
Return true if the specified Principal has the specified
security role, within the context of this Realm; otherwise return
false . |
boolean |
hasUserDataPermission(Request request,
Response response,
SecurityConstraint[] constraint)
Enforce any user data constraint required by the security constraint guarding this request URI. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Remove a property change listener from this component. |
void |
setContainer(Container container)
Set the Container with which this Realm has been associated. |
Method Detail |
---|
Container getContainer()
void setContainer(Container container)
container
- The associated Containerjava.lang.String getInfo()
<description>/<version>
.
void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to addjava.security.Principal authenticate(java.lang.String username, java.lang.String credentials)
null
.
username
- Username of the Principal to look upcredentials
- Password or other credentials to use in
authenticating this usernamejava.security.Principal authenticate(java.lang.String username, byte[] credentials)
null
.
username
- Username of the Principal to look upcredentials
- Password or other credentials to use in
authenticating this usernamejava.security.Principal authenticate(java.lang.String username, java.lang.String digest, java.lang.String nonce, java.lang.String nc, java.lang.String cnonce, java.lang.String qop, java.lang.String realm, java.lang.String md5a2)
null
.
username
- Username of the Principal to look updigest
- Digest which has been submitted by the clientnonce
- Unique (or supposedly unique) token which has been used
for this requestrealm
- Realm namemd5a2
- Second MD5 digest used to calculate the digest :
MD5(Method + ":" + uri)java.security.Principal authenticate(java.security.cert.X509Certificate[] certs)
null
.
certs
- Array of client certificates, with the first one in
the array being the certificate of the client itself.void backgroundProcess()
SecurityConstraint[] findSecurityConstraints(Request request, Context context)
null
if there is no such constraint.
request
- Request we are processingboolean hasResourcePermission(Request request, Response response, SecurityConstraint[] constraint, Context context) throws java.io.IOException
true
if this constraint is satisfied and processing
should continue, or false
otherwise.
request
- Request we are processingresponse
- Response we are creatingconstraint
- Security constraint we are enforcingcontext
- The Context to which client of this class is attached.
java.io.IOException
- if an input/output error occursboolean hasRole(java.security.Principal principal, java.lang.String role)
true
if the specified Principal has the specified
security role, within the context of this Realm; otherwise return
false
.
principal
- Principal for whom the role is to be checkedrole
- Security role to be checkedboolean hasUserDataPermission(Request request, Response response, SecurityConstraint[] constraint) throws java.io.IOException
true
if this constraint
was not violated and processing should continue, or false
if we have created a response already.
request
- Request we are processingresponse
- Response we are creatingconstraint
- Security constraint being checked
java.io.IOException
- if an input/output error occursvoid removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener
- The listener to remove
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |