01: /* Copyright 2004, 2005, 2006 Acegi Technology Pty Limited
02: *
03: * Licensed under the Apache License, Version 2.0 (the "License");
04: * you may not use this file except in compliance with the License.
05: * You may obtain a copy of the License at
06: *
07: * http://www.apache.org/licenses/LICENSE-2.0
08: *
09: * 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: * UsernamePasswordAuthenticationToken extension to carry the Jaas LoginContext that the user was logged into
26: *
27: * @author Ray Krueger
28: */
29: public class JaasAuthenticationToken extends
30: UsernamePasswordAuthenticationToken {
31: //~ Instance fields ================================================================================================
32:
33: private static final long serialVersionUID = 1L;
34: private transient LoginContext loginContext = null;
35:
36: //~ Constructors ===================================================================================================
37:
38: public JaasAuthenticationToken(Object principal,
39: Object credentials, LoginContext loginContext) {
40: super (principal, credentials);
41: this .loginContext = loginContext;
42: }
43:
44: public JaasAuthenticationToken(Object principal,
45: Object credentials, GrantedAuthority[] authorities,
46: LoginContext loginContext) {
47: super (principal, credentials, authorities);
48: this .loginContext = loginContext;
49: }
50:
51: //~ Methods ========================================================================================================
52:
53: public LoginContext getLoginContext() {
54: return loginContext;
55: }
56: }
|