Codota Logo
AbstractJaasAuthenticationProvider
Code IndexAdd Codota to your IDE (free)

How to use
AbstractJaasAuthenticationProvider
in
org.springframework.security.authentication.jaas

Best Java code snippets using org.springframework.security.authentication.jaas.AbstractJaasAuthenticationProvider (Showing top 16 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-security

@Override
public void afterPropertiesSet() throws Exception {
  super.afterPropertiesSet();
  Assert.notNull(this.configuration, "configuration cannot be null.");
}
origin: spring-projects/spring-security

public void onApplicationEvent(SessionDestroyedEvent event) {
  handleLogout(event);
}
origin: spring-projects/spring-security

/**
 * 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}.
 */
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");
}
origin: spring-projects/spring-security

LoginContext loginContext = createLoginContext(
    new InternalCallbackHandler(auth));
publishSuccessEvent(result);
    .resolveException(loginException);
publishFailureEvent(request, ase);
throw ase;
origin: org.springframework.security/spring-security-core

LoginContext loginContext = createLoginContext(
    new InternalCallbackHandler(auth));
publishSuccessEvent(result);
    .resolveException(loginException);
publishFailureEvent(request, ase);
throw ase;
origin: org.springframework.security/org.springframework.security.core

LoginContext loginContext = createLoginContext(new InternalCallbackHandler(auth));
publishSuccessEvent(result);
AuthenticationException ase = loginExceptionResolver.resolveException(loginException);
publishFailureEvent(request, ase);
throw ase;
origin: org.springframework.security/spring-security-core

@Override
public void afterPropertiesSet() throws Exception {
  super.afterPropertiesSet();
  Assert.notNull(this.configuration, "configuration cannot be null.");
}
origin: org.springframework.security/spring-security-core

public void onApplicationEvent(SessionDestroyedEvent event) {
  handleLogout(event);
}
origin: org.springframework.security/spring-security-core

/**
 * 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}.
 */
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");
}
origin: apache/servicemix-bundles

LoginContext loginContext = createLoginContext(
    new InternalCallbackHandler(auth));
publishSuccessEvent(result);
    .resolveException(loginException);
publishFailureEvent(request, ase);
throw ase;
origin: apache/servicemix-bundles

@Override
public void afterPropertiesSet() throws Exception {
  super.afterPropertiesSet();
  Assert.notNull(this.configuration, "configuration cannot be null.");
}
origin: apache/servicemix-bundles

public void onApplicationEvent(SessionDestroyedEvent event) {
  handleLogout(event);
}
origin: org.springframework.security/org.springframework.security.core

/**
 * 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}.
 */
public void afterPropertiesSet() throws Exception {
  Assert.hasLength(loginContextName, "loginContextName cannot be null or empty");
  Assert.notEmpty(authorityGranters, "authorityGranters cannot be null or empty");
  if (ObjectUtils.isEmpty(callbackHandlers)) {
    setCallbackHandlers(new JaasAuthenticationCallbackHandler[] { new JaasNameCallbackHandler(),
        new JaasPasswordCallbackHandler() });
  }
  Assert.notNull(loginExceptionResolver, "loginExceptionResolver cannot be null");
}
origin: org.springframework.security/org.springframework.security.core

@Override
public void afterPropertiesSet() throws Exception {
  super.afterPropertiesSet();
  Assert.notNull(configuration, "configuration cannot be null.");
}
origin: org.springframework.security/org.springframework.security.core

public void onApplicationEvent(SessionDestroyedEvent event) {
  handleLogout(event);
}
origin: apache/servicemix-bundles

/**
 * 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}.
 */
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");
}
org.springframework.security.authentication.jaasAbstractJaasAuthenticationProvider

Javadoc

An AuthenticationProvider implementation that retrieves user details from a JAAS login configuration.

This AuthenticationProvider is capable of validating org.springframework.security.authentication.UsernamePasswordAuthenticationTokenrequests contain the correct username and password.

This implementation is backed by a JAAS configuration that is provided by a subclass's implementation of #createLoginContext(CallbackHandler).

When using JAAS login modules as the authentication source, sometimes the LoginContext will require CallbackHandlers. The AbstractJaasAuthenticationProvider uses an internal CallbackHandler to wrap the JaasAuthenticationCallbackHandlers configured in the ApplicationContext. When the LoginContext calls the internal CallbackHandler, control is passed to each JaasAuthenticationCallbackHandler for each Callback passed.

JaasAuthenticationCallbackHandlers are passed to the AbstractJaasAuthenticationProvider through the #setCallbackHandlers(org.springframework.security.authentication.jaas.JaasAuthenticationCallbackHandler[]) property.

 
<property name="callbackHandlers"> 
<list> 
<bean class="org.springframework.security.authentication.jaas.TestCallbackHandler"/> 
<bean class=" 
JaasNameCallbackHandler"/> 
<bean class=" 
JaasPasswordCallbackHandler"/> 
</list> 
</property> 

After calling LoginContext.login(), the AbstractJaasAuthenticationProvider will retrieve the returned Principals from the Subject (LoginContext.getSubject().getPrincipals). Each returned principal is then passed to the configured AuthorityGranters. An AuthorityGranter is a mapping between a returned Principal, and a role name. If an AuthorityGranter wishes to grant an Authorization a role, it returns that role name from it's AuthorityGranter#grant(java.security.Principal) method. The returned role will be applied to the Authorization object as a GrantedAuthority.

AuthorityGranters are configured in spring xml as follows...

 
<property name="authorityGranters"> 
<list> 
<bean class="org.springframework.security.authentication.jaas.TestAuthorityGranter"/> 
</list> 
</property> 

Most used methods

  • afterPropertiesSet
    Validates the required properties are set. In addition, if #setCallbackHandlers(JaasAuthenticationCa
  • createLoginContext
    Creates the LoginContext to be used for authentication.
  • handleLogout
    Handles the logout by getting the security contexts for the destroyed session and invoking LoginCont
  • publishFailureEvent
    Publishes the JaasAuthenticationFailedEvent. Can be overridden by subclasses for different functiona
  • publishSuccessEvent
    Publishes the JaasAuthenticationSuccessEvent. Can be overridden by subclasses for different function
  • setCallbackHandlers
    Set the JAASAuthentcationCallbackHandler array to handle callback objects generated by the LoginCont

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ResourceBundle (java.util)
    Resource bundles contain locale-specific objects. When your program needs a locale-specific resource
  • StringTokenizer (java.util)
    The string tokenizer class allows an application to break a string into tokens. The tokenization met
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • JTable (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now