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
.security
.OsAuthenticationToken
;
25 import org
.springframework
.security
.core
.Authentication
;
27 /** Login module which caches one subject per thread. */
28 public class SingleUserLoginModule
extends AbstractLoginModule
{
30 protected Authentication
processLogin(CallbackHandler callbackHandler
)
31 throws LoginException
, UnsupportedCallbackException
, IOException
,
32 InterruptedException
{
33 OsAuthenticationToken token
= new OsAuthenticationToken();
34 return getAuthenticationManager().authenticate(token
);