예제 #1
0
 public void assertCredentialsMatch(AuthenticationToken token, AuthenticationInfo info)
     throws AuthenticationException {
   if (PropertyUtil.getBoolean("encrypt")) {
     super.assertCredentialsMatch(token, info);
   } else {
     if (token != null && info != null) {
       CaptchaUsernamePasswordToken tk = (CaptchaUsernamePasswordToken) token;
       if (!(String.valueOf(tk.getPassword())).equals((String) info.getCredentials())) {
         // not successful - throw an exception to indicate this:
         String msg =
             "Submitted credentials for token ["
                 + tk
                 + "] did not match the expected credentials.";
         throw new IncorrectCredentialsException(msg);
       }
     } else {
       throw new AuthenticationException(
           "A CredentialsMatcher must be configured in order to verify "
               + "credentials during authentication.  If you do not wish for credentials to be examined, you "
               + "can configure an "
               + AllowAllCredentialsMatcher.class.getName()
               + " instance.");
     }
   }
 }
예제 #2
0
 @Override
 public void clearCache(PrincipalCollection principals) {
   super.clearCache(principals);
 }
예제 #3
0
 @Override
 public void clearCachedAuthenticationInfo(PrincipalCollection principals) {
   super.clearCachedAuthenticationInfo(principals);
 }
예제 #4
0
 public void removeUserAuthorizationInfoCache(String username) {
   SimplePrincipalCollection pc = new SimplePrincipalCollection();
   pc.add(username, super.getName());
   super.clearCachedAuthorizationInfo(pc);
 }
 @Override
 public void setCredentialsMatcher(CredentialsMatcher credentialsMatcher) {
   credentialsMatcher = new SimpleCredentialsMatcher();
   super.setCredentialsMatcher(credentialsMatcher);
 }
 @Override
 protected void onInit() {
   super.onInit();
   ensureTicketValidator();
 }
 protected void onInit() {
   super.onInit();
 }
 protected void onInit() {
   super.onInit();
   active = true;
   logger.info("Crowd Realm initialized...");
 }
예제 #9
0
 @Override
 protected void checkPermission(Permission permission, AuthorizationInfo info) {
   authorizationValidate(permission);
   super.checkPermission(permission, info);
 }
예제 #10
0
 @Override
 protected void onInit() {
   super.onInit();
   CDIUtil.inject(this);
 }