Example usage for javax.security.auth.login AccountLockedException AccountLockedException

List of usage examples for javax.security.auth.login AccountLockedException AccountLockedException

Introduction

In this page you can find the example usage for javax.security.auth.login AccountLockedException AccountLockedException.

Prototype

public AccountLockedException(String msg) 

Source Link

Document

Constructs a AccountLockedException with the specified detail message.

Usage

From source file:info.magnolia.jaas.sp.jcr.MagnoliaAuthenticationModule.java

/**
 * Checks is the credentials exist in the repository.
 * @throws LoginException or specific subclasses (which will be handled further for user feedback)
 *//*from   ww  w .  j  a va  2s  .c o m*/
@Override
public void validateUser() throws LoginException {
    initUser();

    if (this.user == null) {
        throw new AccountNotFoundException("User account " + this.name + " not found.");
    }

    matchPassword();

    if (!this.user.isEnabled()) {
        throw new AccountLockedException("User account " + this.name + " is locked.");
    }

    if (!UserManager.ANONYMOUS_USER.equals(user.getName()) && !isAdmin()) {
        // update last access date for all non anonymous users
        getUserManager().updateLastAccessTimestamp(user);
    }
}