org.securityfilter.realm
Interface SecurityRealmInterface

All Known Implementing Classes:
CatalinaRealmAdapter, SimpleSecurityRealmBase

public interface SecurityRealmInterface

SecurityRealmInterface - realm interface for SecurityFilter. Implement this interface to provide a realm implementation against which SecurityFilter can authenticate and authortize users. Typically, a project will implement this interface or adapt an existing realm implementation to this interface.

Version:
$Revision: 1.1 $ $Date: 2004/07/03 20:53:44 $
Author:
Max Cooper (max@maxcooper.com)

Method Summary
 Principal authenticate(String username, String password)
          Authenticate a user.
 boolean isUserInRole(Principal principal, String rolename)
          Test for role membership.
 

Method Detail

authenticate

public Principal authenticate(String username,
                              String password)
Authenticate a user.

Parameters:
username - a username
password - a plain text password, as entered by the user
Returns:
a Principal object representing the user if successful, false otherwise

isUserInRole

public boolean isUserInRole(Principal principal,
                            String rolename)
Test for role membership. Use Principal.getName() to get the username from the principal object.

Parameters:
principal - Principal object representing a user
rolename - name of a role to test for membership
Returns:
true if the user is in the role, false otherwise