Example usage for org.springframework.security.authentication.jaas JaasNameCallbackHandler JaasNameCallbackHandler

List of usage examples for org.springframework.security.authentication.jaas JaasNameCallbackHandler JaasNameCallbackHandler

Introduction

In this page you can find the example usage for org.springframework.security.authentication.jaas JaasNameCallbackHandler JaasNameCallbackHandler.

Prototype

JaasNameCallbackHandler

Source Link

Usage

From source file:org.springframework.security.authentication.jaas.AbstractJaasAuthenticationProvider.java

/**
 * Validates the required properties are set. In addition, if
 * {@link #setCallbackHandlers(JaasAuthenticationCallbackHandler[])} has not been
 * called with valid handlers, initializes to use {@link JaasNameCallbackHandler} and
 * {@link JaasPasswordCallbackHandler}./* w ww .  ja  va 2 s  .c  o  m*/
 */
public void afterPropertiesSet() throws Exception {
    Assert.hasLength(this.loginContextName, "loginContextName cannot be null or empty");
    Assert.notEmpty(this.authorityGranters, "authorityGranters cannot be null or empty");
    if (ObjectUtils.isEmpty(this.callbackHandlers)) {
        setCallbackHandlers(new JaasAuthenticationCallbackHandler[] { new JaasNameCallbackHandler(),
                new JaasPasswordCallbackHandler() });
    }
    Assert.notNull(this.loginExceptionResolver, "loginExceptionResolver cannot be null");
}