KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > geronimo > security > jaas > JaasLoginServiceMBean


1 /**
2  *
3  * Copyright 2003-2004 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17 package org.apache.geronimo.security.jaas;
18
19 import java.security.Principal JavaDoc;
20 import java.util.Collection JavaDoc;
21 import javax.security.auth.callback.Callback JavaDoc;
22 import javax.security.auth.login.LoginException JavaDoc;
23
24 import org.apache.geronimo.common.GeronimoSecurityException;
25
26 /**
27  * Interface used to connect to the JaasLoginService via remoting, etc. This
28  * may no longer be necessary?
29  *
30  * @version $Rev: 46019 $ $Date: 2004-09-14 05:56:06 -0400 (Tue, 14 Sep 2004) $
31  */

32 public interface JaasLoginServiceMBean {
33     /**
34      * GBean property
35      */

36     public Collection JavaDoc getRealms() throws GeronimoSecurityException;
37
38     /**
39      * GBean property
40      */

41     public void setRealms(Collection JavaDoc realms);
42
43     /**
44      * GBean property
45      */

46     public int getMaxLoginDurationMillis();
47
48     /**
49      * GBean property
50      */

51     public void setMaxLoginDurationMillis(int maxLoginDurationMillis);
52
53     /**
54      * GBean property
55      */

56     public int getExpiredLoginScanIntervalMillis();
57
58     /**
59      * GBean property
60      */

61     public void setExpiredLoginScanIntervalMillis(int expiredLoginScanIntervalMillis);
62
63     /**
64      * Starts a new authentication process on behalf of an end user. The
65      * returned ID will identify that user throughout the user's interaction
66      * with the server. On the server side, that means maintaining the
67      * Subject and Principals for the user.
68      *
69      * @return The UserIdentifier used as an argument for the rest of the
70      * methods in this class.
71      */

72     public JaasClientId connectToRealm(String JavaDoc realmName);
73
74     /**
75      * Gets the login module configuration for the specified realm. The
76      * caller needs that in order to perform the authentication process.
77      */

78     public JaasLoginModuleConfiguration[] getLoginConfiguration(JaasClientId userIdentifier) throws LoginException JavaDoc ;
79
80     /**
81      * Retrieves callbacks for a server side login module. When the client
82      * is going through the configured login modules, if a specific login
83      * module is client-side, it will be handled directly. If it is
84      * server-side, the client gets the callbacks (using this method),
85      * populates them, and sends them back to the server.
86      */

87     public Callback JavaDoc[] getServerLoginCallbacks(JaasClientId userIdentifier, int loginModuleIndex) throws LoginException JavaDoc;
88
89     /**
90      * Returns populated callbacks for a server side login module. When the
91      * client is going through the configured login modules, if a specific
92      * login module is client-side, it will be handled directly. If it is
93      * server-side, the client gets the callbacks, populates them, and sends
94      * them back to the server (using this method).
95      */

96     public boolean performServerLogin(JaasClientId userIdentifier, int loginModuleIndex, Callback JavaDoc[] results) throws LoginException JavaDoc;
97
98     /**
99      * Indicates that the overall login succeeded, and some principals were
100      * generated by a client-side login module. This method needs to be called
101      * once for each client-side login module, to specify Principals for each
102      * module.
103      */

104     public void clientLoginModuleCommit(JaasClientId userIdentifier, int loginModuleIndex, Principal JavaDoc[] clientLoginModulePrincipals) throws LoginException JavaDoc;
105
106     /**
107      * Indicates that the overall login succeeded, and a particular server-side
108      * login module should be committed. This method needs to be called
109      * once for each server-side login module that was processed before the
110      * overall authentication succeeded.
111      */

112     public boolean serverLoginModuleCommit(JaasClientId userIdentifier, int loginModuleIndex) throws LoginException JavaDoc;
113
114     /**
115      * Indicates that the overall login succeeded. All login modules that were
116      * touched should have been logged in and committed before calling this.
117      */

118     public Principal JavaDoc[] loginSucceeded(JaasClientId userIdentifier) throws LoginException JavaDoc;
119
120     /**
121      * Indicates that the overall login failed, and the server should release
122      * any resources associated with the user ID.
123      */

124     public void loginFailed(JaasClientId userIdentifier);
125
126     /**
127      * Indicates that the client has logged out, and the server should release
128      * any resources associated with the user ID.
129      */

130     public void logout(JaasClientId userIdentifier) throws LoginException JavaDoc;
131 }
132
Popular Tags