View Javadoc

1   /*
2    * Copyright (c) 2004 UNINETT FAS
3    *
4    * This program is free software; you can redistribute it and/or modify it
5    * under the terms of the GNU General Public License as published by the Free
6    * Software Foundation; either version 2 of the License, or (at your option)
7    * any later version.
8    *
9    * This program is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11   * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12   * more details.
13   *
14   * You should have received a copy of the GNU General Public License along with
15   * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16   * Place - Suite 330, Boston, MA 02111-1307, USA.
17   *
18   * $Id: AuthenticationIF.java,v 1.8 2005/06/23 11:21:41 catoolsen Exp $
19   */
20  
21  package no.feide.moria.webservices.v2_0;
22  
23  import java.rmi.Remote;
24  import java.rmi.RemoteException;
25  
26  /***
27   * @author Bjørn Ola Smievoll <b.o.smievoll@conduct.no>
28   * @version $Revision: 1.8 $
29   */
30  public interface AuthenticationIF extends Remote {
31  
32      /***
33       * Initiates authentication.
34       *
35       * The initial call done by a service to start a login attempt.
36       *
37       * @param attributes
38       *          The attributes the service wants returned on login
39       * @param returnURLPrefix
40       *          The prefix of the url the user is to be returned to
41       * @param returnURLPostfix
42       *          The optional postfix of the return url
43       * @param forceInteractiveAuthentication
44       *          Whether or not cookie based authentication (SSO Light)
45       *          should be allowed.
46       * @return The Moria url the client is to be redirected to.
47       * @throws RemoteException
48       *          If anything fails during the call.
49       */
50      String initiateAuthentication(String[] attributes, String returnURLPrefix, String returnURLPostfix,
51              boolean forceInteractiveAuthentication) throws RemoteException;
52  
53      /***
54       * Performs direct non-interactive authentication.
55       *
56       * A redirect- and html-less login method.  Only to be used in
57       * special cases where the client for some reason does not
58       * support the standard login procedure.  Inherently insecure as
59       * the service will have knowledge of the plaintext password.
60       *
61       * @param attributes
62       *          The attributes the service wants returned on login.
63       * @param username
64       *          The user name of the user to be authenticated.
65       * @param password
66       *          The password of the user to be authenticated.
67       * @return Array of attributes as requested.
68       * @throws RemoteException
69       *          If anything fails during the call.
70       */
71      Attribute[] directNonInteractiveAuthentication(String[] attributes, String username, String password) throws RemoteException;
72  
73      /***
74       * Gets user attributes.
75       *
76       * Called by the service when the user returns after a successful
77       * login.
78       *
79       * @param serviceTicket
80       *          The ticket included in the return request issued by the client.
81       * @return Array of attributes as requested in initiateAuthentication.
82       * @throws RemoteException
83       *          If anything fails during the call.
84       */
85      Attribute[] getUserAttributes(String serviceTicket) throws RemoteException;
86  
87      /***
88       * Verifies the existence of a given user in the underlying directories.
89       *
90       * @param username
91       *          The username to be validated.
92       * @return true if the user is found.
93       * @throws RemoteException
94       *          If anything fails during the call.
95       */
96      boolean verifyUserExistence(String username) throws RemoteException;
97  }