Пример #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);
 }