NAME
Wombat::Realm::RealmBase - internal realm base clas
SYNOPSIS
DESCRIPTION
Convenience base implementation of Wombat::Realm. Subclasses should implement getName()
, getPassword()
, and getPrincipal()
.
CONSTRUCTOR
- new()
-
Construct and return a Wombat::Realm::RealmBase instance, initializing fields appropriately. If subclasses override the constructor, they must be sure to call
$self->SUPER::new();
ACCESSOR METHODS
- getAlgorithm()
-
Return the digest algorithm used for authenticating credentials. If no algorithm is specified, credentials will be used as submitted.
- setAlgorithm($algorithm)
-
Set the digest algorithm used for authenticating credentials. Supported algorithms include: MD5, SHA1, HMAC, MD2, and anything else provided by the Digest library.
Parameters:
- getContainer()
-
Return the Container associated with this Realm.
- setContainer($container)
-
Set the Container associated with this Realm.
Parameters:
PUBLIC METHODS
- authenticate ($username, $credentials)
-
Return the Principal associated with the specified username and credentials, if there is one, or
undef
otherwise.Parameters
- hasRole($principal, $role)
-
Return true if the specified Principal has the specified security role within the context of this Realm, or false otherwise.
Parameters:
PACKAGE METHODS
- digest()
-
Digest a submitted password using the configured algorithm and convert the result to a corresponding hexadecimal string. If an exception is thrown, the plain credentials string is returned.
Parameters:
- getName()
-
Return a short name for this Realm implementation. Must be overridden by subclasses.
- getPassword($username)
-
Return the password associated with the given Principal's user name. Should be overridden by subclasses.
Parameters:
- getPrincipal($username)
-
Return the Principal associated with the given user name. Should be overridden by subclasses.
Parameters:
LIFECYCLE METHODS
- start()
-
Prepare for active use of this Realm. This method should be called before any of the public methods of the Realm are utilized.
Throws:
- stop()
-
Gracefully terminate active use of this Realm. Once this method has been called, no public methods of the Realm should be utilized.
Throws:
SEE ALSO
Digest, Wombat::Container, Wombat::Exception, Wombat::Realm, Wombat::Realm::GenericPrincipal
AUTHOR
Brian Moseley, bcm@maz.org