Showing the changes to java/pkg/sun/net/www/protocol/http/HttpAuthenticator.java (1 of 18352 files). Show all
Unified · Split
| @@ -0,0 +1,76 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 1996, 2004, Oracle and/or its affiliates. All rights reserved. | |
| 3 | + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
| 4 | + * | |
| 5 | + * This code is free software; you can redistribute it and/or modify it | |
| 6 | + * under the terms of the GNU General Public License version 2 only, as | |
| 7 | + * published by the Free Software Foundation. Oracle designates this | |
| 8 | + * particular file as subject to the "Classpath" exception as provided | |
| 9 | + * by Oracle in the LICENSE file that accompanied this code. | |
| 10 | + * | |
| 11 | + * This code is distributed in the hope that it will be useful, but WITHOUT | |
| 12 | + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
| 13 | + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
| 14 | + * version 2 for more details (a copy is included in the LICENSE file that | |
| 15 | + * accompanied this code). | |
| 16 | + * | |
| 17 | + * You should have received a copy of the GNU General Public License version | |
| 18 | + * 2 along with this work; if not, write to the Free Software Foundation, | |
| 19 | + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |
| 20 | + * | |
| 21 | + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA | |
| 22 | + * or visit www.oracle.com if you need additional information or have any | |
| 23 | + * questions. | |
| 24 | + */ | |
| 25 | + | |
| 26 | +package sun.net.www.protocol.http; | |
| 27 | + | |
| 28 | +import java.net.URL; | |
| 29 | + | |
| 30 | +/** | |
| 31 | + * An interface for all objects that implement HTTP authentication. | |
| 32 | + * See the HTTP spec for details on how this works in general. | |
| 33 | + * A single class or object can implement an arbitrary number of | |
| 34 | + * authentication schemes. | |
| 35 | + * | |
| 36 | + * @author David Brown | |
| 37 | + * | |
| 38 | + * @deprecated -- use java.net.Authenticator instead | |
| 39 | + * @see java.net.Authenticator | |
| 40 | + */ | |
| 41 | +// | |
| 42 | +// REMIND: Unless compatibility with sun.* API's from 1.2 to 2.0 is | |
| 43 | +// a goal, there's no reason to carry this forward into JDK 2.0. | |
| 44 | +@Deprecated | |
| 45 | +public interface HttpAuthenticator { | |
| 46 | + | |
| 47 | + | |
| 48 | + /** | |
| 49 | + * Indicate whether the specified authentication scheme is | |
| 50 | + * supported. In accordance with HTTP specifications, the | |
| 51 | + * scheme name should be checked in a case-insensitive fashion. | |
| 52 | + */ | |
| 53 | + | |
| 54 | + boolean schemeSupported (String scheme); | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * Returns the String that should be included in the HTTP | |
| 58 | + * <B>Authorization</B> field. Return null if no info was | |
| 59 | + * supplied or could be found. | |
| 60 | + * <P> | |
| 61 | + * Example: | |
| 62 | + * --> GET http://www.authorization-required.com/ HTTP/1.0 | |
| 63 | + * <-- HTTP/1.0 403 Unauthorized | |
| 64 | + * <-- WWW-Authenticate: Basic realm="WallyWorld" | |
| 65 | + * call schemeSupported("Basic"); (return true) | |
| 66 | + * call authString(u, "Basic", "WallyWorld", null); | |
| 67 | + * return "QWadhgWERghghWERfdfQ==" | |
| 68 | + * --> GET http://www.authorization-required.com/ HTTP/1.0 | |
| 69 | + * --> Authorization: Basic QWadhgWERghghWERfdfQ== | |
| 70 | + * <-- HTTP/1.0 200 OK | |
| 71 | + * <B> YAY!!!</B> | |
| 72 | + */ | |
| 73 | + | |
| 74 | + public String authString (URL u, String scheme, String realm); | |
| 75 | + | |
| 76 | +} | |