예제 #1
0
파일: Shaj.java 프로젝트: walware/rj-core
 /**
  * Tests if a user is a member of a specific group.
  *
  * @param domain the (platform-specific) domain/service to used to perform the check. May be
  *     <code>null</code> (which has a platform-specific meaning).
  * @param username the username to test for membership
  * @param group the group to look in
  * @return true if the user is a member of the group
  * @throws IllegalArgumentException if <code>username</code> or <code>group</code> are <code>null
  *     </code>.
  * @throws IllegalStateException if Shaj did not load correctly (if {@link Shaj#init()} returns
  *     false).
  */
 public static boolean checkGroupMembership(
     final String domain, final String username, final String group) {
   return Authenticator.getDefault()
       .checkGroupMembership(domain, username, group, Log.Factory.getInstance());
 }
예제 #2
0
파일: Shaj.java 프로젝트: walware/rj-core
 /**
  * Checks a user's password.
  *
  * @param domain the (platform-specific) domain/service to used to perform the check. May be
  *     <code>null</code> (which has a platform-specific meaning).
  * @param username the username
  * @param password the password to verify
  * @return true if the password matches the username
  * @throws IllegalArgumentException if <code>username</code> or <code>password</code> are <code>
  *     null</code>.
  * @throws IllegalStateException if Shaj did not load correctly (if {@link Shaj#init()} returns
  *     false).
  */
 public static boolean checkPassword(
     final String domain, final String username, final String password) {
   return Authenticator.getDefault()
       .checkPassword(domain, username, password, Log.Factory.getInstance());
 }