View Javadoc

    1   package org.acegisecurity.providers.jaas;
    2
    3   import javax.security.auth.login.LoginContext;
    4
    5   import org.acegisecurity.GrantedAuthority;
    6   import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
    7
    8   /***
    9    * UsernamePasswordAuthenticationToken extension to carry the Jaas LoginContext that the user was logged into
    10   * @author Ray Krueger
    11   */
    12  public class JaasAuthenticationToken extends UsernamePasswordAuthenticationToken {
    13
    14      private transient LoginContext loginContext = null;
    15
    16      public JaasAuthenticationToken(Object principal, Object credentials, LoginContext loginContext) {
    17          super(principal, credentials);
    18          this.loginContext = loginContext;
    19      }
    20
    21      public JaasAuthenticationToken(Object principal, Object credentials, GrantedAuthority[] authorities, LoginContext loginContext) {
    22          super(principal, credentials, authorities);
    23          this.loginContext = loginContext;
    24      }
    25
    26      public LoginContext getLoginContext() {
    27          return loginContext;
    28      }
    29  }