KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mortbay > http > SSORealm


1 // ========================================================================
2
// $Id: SSORealm.java,v 1.4 2004/05/09 20:31:40 gregwilkins Exp $
3
// Copyright 1996-2004 Mort Bay Consulting Pty. Ltd.
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
// http://www.apache.org/licenses/LICENSE-2.0
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
// ========================================================================
15

16 package org.mortbay.http;
17
18 import java.security.Principal JavaDoc;
19
20 import org.mortbay.util.Credential;
21
22 /* ------------------------------------------------------------ */
23 /** Single Sign On Realm.
24  * This interface is a mix-in interface for the UserRealm interface. If an
25  * implementation of UserRealm also implements SSORealm, then single signon
26  * is supported for that realm.
27  
28  * @see UserRealm
29  * @version $Id: SSORealm.java,v 1.4 2004/05/09 20:31:40 gregwilkins Exp $
30  * @author Greg Wilkins (gregw)
31  */

32
33 public interface SSORealm
34 {
35     /** Get SSO credentials.
36      * This call is used by an authenticator to check if a SSO exists for a request.
37      * If SSO authentiation is successful, the requests UserPrincipal and
38      * AuthUser fields are set. If available, the credential used to
39      * authenticate the user is returned. If recoverable credentials are not required then
40      * null may be return.
41      * @param request The request to SSO.
42      * @param response The response to SSO.
43      * @return A credential if available for SSO authenticated requests.
44      */

45     public Credential getSingleSignOn(HttpRequest request,
46                                       HttpResponse response);
47     
48     /** Set SSO principal and credential.
49      * This call is used by an authenticator to inform the SSO mechanism that
50      * a user has signed on. The SSO mechanism should record the principal
51      * and credential and update the response with any cookies etc. required.
52      * @param request The authenticated request.
53      * @param response The authenticated response/
54      * @param principal The principal that has been authenticated.
55      * @param credential The credentials used to authenticate.
56      */

57     
58     public void setSingleSignOn(HttpRequest request,
59                                 HttpResponse response,
60                                 Principal JavaDoc principal,
61                                 Credential credential);
62     
63     /** Clear SSO for user.
64      * @param username The user to clear.
65      */

66     public void clearSingleSignOn(String JavaDoc username);
67 }
68
Popular Tags