]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms/src/org/argeo/cms/internal/auth/SystemLoginModule.java
Use message instead of label in user menu
[lgpl/argeo-commons.git] / org.argeo.cms / src / org / argeo / cms / internal / auth / SystemLoginModule.java
1 /*
2 * Copyright (C) 2007-2012 Argeo GmbH
3 *
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
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
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.
15 */
16 package org.argeo.cms.internal.auth;
17
18 import java.io.IOException;
19
20 import javax.security.auth.callback.CallbackHandler;
21 import javax.security.auth.callback.UnsupportedCallbackException;
22 import javax.security.auth.login.LoginException;
23
24 import org.argeo.cms.internal.kernel.Activator;
25 import org.argeo.security.core.InternalAuthentication;
26 import org.springframework.security.core.Authentication;
27
28 /** Login module which caches one subject per thread. */
29 public class SystemLoginModule extends AbstractLoginModule {
30 @Override
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);
37 }
38 }