1 /*
2 * Copyright 2001-2009 The Apache Software Foundation.
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 */
17
18 package org.apache.juddi.v3.auth;
19
20 import javax.xml.ws.WebServiceContext;
21 import org.apache.juddi.model.UddiEntityPublisher;
22 import org.apache.juddi.v3.error.AuthenticationException;
23 import org.apache.juddi.v3.error.FatalErrorException;
24
25 /**
26 * Authenticator interface. Any class implementing this interface can be invoked by
27 * the AuthenticatorFactory to handle authentication of the user executing a UDDI request.
28 *
29 * This occurs in two steps:
30 *
31 * 1) Authenticating the user based the passed credentials
32 * 2) Identifying the user by associating either the authorizationKey or user Id with publisher information
33 *
34 * @author Steve Viens (sviens@apache.org)
35 * @author <a href="mailto:jfaath@apache.org">Jeff Faath</a>
36 */
37 public interface Authenticator {
38
39 /**
40 * This function is called from the Security API's GetAuthToken().
41 *
42 * @param authorizedName - userId of the user making the registry request
43 * @param cred - some authentical creditial (i.e. a password) which can be used to
44 * authenticate the user.
45 *
46 * @return The publisherID for this user
47 * @throws org.apache.juddi.v3.error.AuthenticationException
48 * @throws org.apache.juddi.v3.error.FatalErrorException
49 */
50 String authenticate(String authorizedName, String cred) throws AuthenticationException, FatalErrorException;
51
52 /*
53 * Either input parameter can be used to populate the publisher object
54 *
55 * @param authInfo - the authorization token
56 * @param authorizedName - the authorized Name
57 * @param ctx - WebServiceContext, used for HTTP based authentication if desired (since 3.2.1)
58 * @return - The entity publisher
59 */
60 UddiEntityPublisher identify(String authInfo, String authorizedName, WebServiceContext ctx) throws AuthenticationException, FatalErrorException;
61 }