org.mortbay.http
Interface UserPrincipal

All Superinterfaces:
java.security.Principal

public interface UserPrincipal
extends java.security.Principal

User Principal. Extends the security principal with a method to check if the user is in a role.

Version:
$Id: UserPrincipal.java,v 1.2 2001/10/21 00:32:12 gregwilkins Exp $
Author:
Greg Wilkins (gregw)

Field Summary
static java.lang.String __ATTR
           
 
Method Summary
 boolean authenticate(java.lang.String credentials, HttpRequest request)
          Authenticate the users credentials
 UserRealm getUserRealm()
           
 boolean isUserInRole(java.lang.String role)
          Check if the user is in a role.
 
Methods inherited from interface java.security.Principal
equals, getName, hashCode, toString
 

Field Detail

__ATTR

public static final java.lang.String __ATTR
Method Detail

getUserRealm

public UserRealm getUserRealm()
Returns:
The Realm for this user.

authenticate

public boolean authenticate(java.lang.String credentials,
                            HttpRequest request)
Authenticate the users credentials
Parameters:
credentials - The user credentials, normally a password.
request - The request to be authenticated. Additional parameters may be extracted or set on this request as needed for the authentication mechanism (none required for BASIC and FORM authentication).
Returns:
True if the user credentials are OK.

isUserInRole

public boolean isUserInRole(java.lang.String role)
Check if the user is in a role.
Parameters:
role - A role name.
Returns:
True if the user can act in that role.


Copyright © 2000 Mortbay Consulting Pty. Ltd. All Rights Reserved.