|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.cenqua.shaj.Shaj
A simple way of verifying username/passwords (authentication) and checking group membership. Passwords and group membership is checked with the underlying operating system (see below for a discussion on platform-specific behavior).
The checkPassword(String, String, String) and
checkGroupMembership(String, String, String)
methods both require a "domain" parameter. The exact meaning of this parameter is
platform-specific. These static methods simply call through to the corresponding methods
in the default Authenticator.
This class is multi-thread safe.
Note: Shaj needs to load the "shaj" native library (e.g. "libshaj.so" on Linux, "shaj.dll" on win32, etc.).
If this process fails for any reason, an error is logged and most of the methods will throw IllegalStateException.
The init() method can be called to determine if Shaj was sucessfully initialized.
When necessary, Shaj performs logging using the Log class.
Platform specific notes:
For further information, see the specific implementation classes
Win32Authenticator and PAMAuthenticator.
| Constructor Summary | |
Shaj()
|
|
| Method Summary | |
static boolean |
checkGroupMembership(java.lang.String domain,
java.lang.String username,
java.lang.String group)
Tests if a user is a member of a specific group. |
static boolean |
checkPassword(java.lang.String domain,
java.lang.String username,
java.lang.String password)
Checks a user's password. |
static boolean |
init()
Forces Shaj to load its required resources (native libraries, etc). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Shaj()
| Method Detail |
public static boolean init()
public static boolean checkPassword(java.lang.String domain,
java.lang.String username,
java.lang.String password)
domain - the (platform-specific) domain/service to used to perform the check.
May be null (which has a platform-specific meaning).username - the usernamepassword - the password to verify
java.lang.IllegalArgumentException - if username
or password are null.
java.lang.IllegalStateException - if Shaj did not load correctly (if init() returns false).
public static boolean checkGroupMembership(java.lang.String domain,
java.lang.String username,
java.lang.String group)
domain - the (platform-specific) domain/service to used to perform the check.
May be null (which has a platform-specific meaning).username - the username to test for membershipgroup - the group to look in
java.lang.IllegalArgumentException - if username
or group are null.
java.lang.IllegalStateException - if Shaj did not load correctly (if init() returns false).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||