KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. 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.server;
18
19 import java.security.Principal JavaDoc;
20 import java.util.Collection JavaDoc;
21 import java.util.Map JavaDoc;
22 import java.util.Set JavaDoc;
23 import javax.security.auth.callback.Callback JavaDoc;
24 import javax.security.auth.login.LoginException JavaDoc;
25
26 import org.apache.geronimo.common.GeronimoSecurityException;
27 import org.apache.geronimo.management.geronimo.LoginService;
28
29
30 /**
31  * Interface used to connect to the JaasLoginService via remoting, etc. This
32  * may no longer be necessary?
33  *
34  * @version $Rev: 476049 $ $Date: 2006-11-16 23:35:17 -0500 (Thu, 16 Nov 2006) $
35  */

36 public interface JaasLoginServiceMBean extends LoginService {
37     /**
38      * Starts a new authentication process on behalf of an end user. The
39      * returned session id will identify that user throughout the user's interaction
40      * with the server. On the server side, that means maintaining the
41      * Subject and Principals for the user.
42      *
43      * @return The <code>JaasSessionId</code> used as an argument for the rest of the
44      * methods in this class.
45      */

46     public JaasSessionId connectToRealm(String JavaDoc realmName);
47
48     /**
49      * Gets the login module configuration for the specified realm. The
50      * caller needs that in order to perform the authentication process.
51      */

52     public JaasLoginModuleConfiguration[] getLoginConfiguration(JaasSessionId sessionHandle) throws LoginException JavaDoc;
53
54     /**
55      * Retrieves callbacks for a server side login module. When the client
56      * is going through the configured login modules, if a specific login
57      * module is client-side, it will be handled directly. If it is
58      * server-side, the client gets the callbacks (using this method),
59      * populates them, and sends them back to the server.
60      */

61     public Callback JavaDoc[] getServerLoginCallbacks(JaasSessionId sessionHandle, int loginModuleIndex) throws LoginException JavaDoc;
62
63     /**
64      * Returns populated callbacks for a server side login module. When the
65      * client is going through the configured login modules, if a specific
66      * login module is client-side, it will be handled directly. If it is
67      * server-side, the client gets the callbacks, populates them, and sends
68      * them back to the server (using this method).
69      */

70     public boolean performLogin(JaasSessionId sessionHandle, int loginModuleIndex, Callback JavaDoc[] results) throws LoginException JavaDoc;
71
72     /**
73      * Indicates that the overall login succeeded, and some principals were
74      * generated by a client-side login module. This method needs to be called
75      * once for each client-side login module, to specify Principals for each
76      * module.
77      */

78     public boolean performCommit(JaasSessionId sessionHandle, int loginModuleIndex) throws LoginException JavaDoc;
79
80     /**
81      * Indicates that the overall login succeeded. All login modules that were
82      * touched should have been logged in and committed before calling this.
83      *
84      * @param sessionHandle the handle to the login session
85      * @return the identifier principal
86      * @throws LoginException if the handle is no longer valid.
87      */

88     public Principal JavaDoc loginSucceeded(JaasSessionId sessionHandle) throws LoginException JavaDoc;
89
90     /**
91      * Indicates that the overall login failed, and the server should release
92      * any resources associated with the user ID.
93      */

94     public void loginFailed(JaasSessionId sessionHandle);
95
96     /**
97      * Indicates that the client has logged out, and the server should release
98      * any resources associated with the user ID.
99      */

100     public void logout(JaasSessionId sessionHandle) throws LoginException JavaDoc;
101
102     /**
103      * Syncs the shared state that's on the client with the shared state that
104      * is on the server.
105      *
106      * @param sessionHandle
107      * @param sharedState the shared state that is on the client
108      * @return the sync'd shared state that is on the server
109      */

110     public Map JavaDoc syncShareState(JaasSessionId sessionHandle, Map JavaDoc sharedState) throws LoginException JavaDoc;
111
112     /**
113      * Syncs the set of principals that are on the client with the set of principals that
114      * are on the server.
115      *
116      * @param sessionHandle
117      * @param principals the set of principals that are on the client side
118      * @return the sync'd set of principals that are on the server
119      */

120     public Set JavaDoc syncPrincipals(JaasSessionId sessionHandle, Set JavaDoc principals) throws LoginException JavaDoc;
121
122     /**
123      * Indicates that the overall login failed. This method needs to be called
124      * once for each client-side login module.
125      */

126     public boolean performAbort(JaasSessionId sessionHandle, int lmIndex) throws LoginException JavaDoc;
127 }
128
Popular Tags