2 * Copyright (C) 2007-2012 Argeo GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org
.argeo
.cms
.internal
.auth
;
18 import java
.io
.IOException
;
20 import javax
.security
.auth
.callback
.CallbackHandler
;
21 import javax
.security
.auth
.callback
.UnsupportedCallbackException
;
22 import javax
.security
.auth
.login
.LoginException
;
24 import org
.argeo
.cms
.internal
.kernel
.Activator
;
25 import org
.argeo
.security
.core
.InternalAuthentication
;
26 import org
.springframework
.security
.core
.Authentication
;
28 /** Login module which caches one subject per thread. */
29 public class SystemLoginModule
extends AbstractLoginModule
{
31 protected Authentication
processLogin(CallbackHandler callbackHandler
)
32 throws LoginException
, UnsupportedCallbackException
, IOException
,
33 InterruptedException
{
34 InternalAuthentication token
= new InternalAuthentication(
35 Activator
.getSystemKey());
36 return getAuthenticationManager().authenticate(token
);