Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  * Licensed to Jasig under one or more contributor license
  * agreements. See the NOTICE file distributed with this work
  * for additional information regarding copyright ownership.
  * Jasig licenses this file to you under the Apache License,
  * Version 2.0 (the "License"); you may not use this file
  * except in compliance with the License.  You may obtain a
  * copy of the License at the following location:
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
package org.jasig.cas.adaptors.generic;
AuthenticationHandler which fails to authenticate a user purporting to be one of the blocked usernames, and blindly authenticates all other users.

Note that RejectUsersAuthenticationHandler throws an exception when the user is found in the map. This is done to indicate that this is an extreme case and any AuthenticationManager checking the RejectUsersAuthenticationHandler should not continue checking other Authentication Handlers on the failure of RejectUsersAuthenticationHandler to authenticate someone.

Scott Battaglia
$Revision$ $Date$
public class RejectUsersAuthenticationHandler extends
The collection of users to reject.
    private List<Stringusers;
    protected final boolean authenticateUsernamePasswordInternal(final UsernamePasswordCredentials credentialsthrows AuthenticationException {
        final String transformedUsername = getPrincipalNameTransformer().transform(credentials.getUsername());
        if (this..contains(transformedUsername)) {
            throw new BlockedCredentialsAuthenticationException();
        return true;

Set the Collection of usernames which we will fail to authenticate.

users The Collection of usernames we should not authenticate.
    public final void setUsers(final List<Stringusers) {
        this. = users;
New to GrepCode? Check out our FAQ X