Coverage Report - org.acegisecurity.providers.jaas.JaasAuthenticationToken
 
Classes in this File Line Coverage Branch Coverage Complexity
JaasAuthenticationToken
100% 
N/A 
1
 
 1  
 /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
 2  
  *
 3  
  * Licensed under the Apache License, Version 2.0 (the "License");
 4  
  * you may not use this file except in compliance with the License.
 5  
  * You may obtain a copy of the License at
 6  
  *
 7  
  *     http://www.apache.org/licenses/LICENSE-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing, software
 10  
  * distributed under the License is distributed on an "AS IS" BASIS,
 11  
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12  
  * See the License for the specific language governing permissions and
 13  
  * limitations under the License.
 14  
  */
 15  
 
 16  
 package org.acegisecurity.providers.jaas;
 17  
 
 18  
 import org.acegisecurity.GrantedAuthority;
 19  
 
 20  
 import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
 21  
 
 22  
 import javax.security.auth.login.LoginContext;
 23  
 
 24  
 
 25  
 /**
 26  
  * UsernamePasswordAuthenticationToken extension to carry the Jaas LoginContext that the user was logged into
 27  
  *
 28  
  * @author Ray Krueger
 29  
  */
 30  
 public class JaasAuthenticationToken extends UsernamePasswordAuthenticationToken {
 31  
     //~ Instance fields ================================================================================================
 32  
 
 33  
     private static final long serialVersionUID = 1L;
 34  5
     private transient LoginContext loginContext = null;
 35  
 
 36  
     //~ Constructors ===================================================================================================
 37  
 
 38  
     public JaasAuthenticationToken(Object principal, Object credentials, LoginContext loginContext) {
 39  1
         super(principal, credentials);
 40  1
         this.loginContext = loginContext;
 41  1
     }
 42  
 
 43  
     public JaasAuthenticationToken(Object principal, Object credentials, GrantedAuthority[] authorities,
 44  
         LoginContext loginContext) {
 45  4
         super(principal, credentials, authorities);
 46  4
         this.loginContext = loginContext;
 47  4
     }
 48  
 
 49  
     //~ Methods ========================================================================================================
 50  
 
 51  
     public LoginContext getLoginContext() {
 52  1
         return loginContext;
 53  
     }
 54  
 }