001// ***************************************************************************************************************************
002// * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements.  See the NOTICE file *
003// * distributed with this work for additional information regarding copyright ownership.  The ASF licenses this file        *
004// * to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance            *
005// * with the License.  You may obtain a copy of the License at                                                              *
006// *                                                                                                                         *
007// *  http://www.apache.org/licenses/LICENSE-2.0                                                                             *
008// *                                                                                                                         *
009// * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an  *
010// * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the License for the        *
011// * specific language governing permissions and limitations under the License.                                              *
012// ***************************************************************************************************************************
013package org.apache.juneau.http;
014
015import org.apache.juneau.http.annotation.*;
016
017/**
018 * Represents a parsed <l> Proxy-Authenticate</l> HTTP response header.
019 *
020 * <p>
021 * Request authentication to access the proxy.
022 *
023 * <h5 class='figure'>Example</h5>
024 * <p class='bcode w800'>
025 *    Proxy-Authenticate: Basic
026 * </p>
027 *
028 * <h5 class='topic'>RFC2616 Specification</h5>
029 *
030 * The Proxy-Authenticate response-header field MUST be included as part of a 407 (Proxy Authentication Required)
031 * response.
032 * The field value consists of a challenge that indicates the authentication scheme and parameters applicable to the
033 * proxy for this Request-URI.
034 *
035 * <p class='bcode w800'>
036 *    Proxy-Authenticate  = "Proxy-Authenticate" ":" 1#challenge
037 * </p>
038 *
039 * <p>
040 * The HTTP access authentication process is described in "HTTP Authentication: Basic and Digest Access Authentication".
041 * Unlike WWW-Authenticate, the Proxy-Authenticate header field applies only to the current connection and SHOULD NOT
042 * be passed on to downstream clients.
043 * However, an intermediate proxy might need to obtain its own credentials by requesting them from the downstream
044 * client, which in some circumstances will appear as if the proxy is forwarding the Proxy-Authenticate header field.
045 *
046 * <ul class='seealso'>
047 *    <li class='extlink'>{@doc RFC2616}
048 * </ul>
049 */
050@Header("Proxy-Authenticate")
051public final class ProxyAuthenticate extends HeaderString {
052
053   /**
054    * Returns a parsed <c>Proxy-Authenticate</c> header.
055    *
056    * @param value The <c>Proxy-Authenticate</c> header string.
057    * @return The parsed <c>Proxy-Authenticate</c> header, or <jk>null</jk> if the string was null.
058    */
059   public static ProxyAuthenticate forString(String value) {
060      if (value == null)
061         return null;
062      return new ProxyAuthenticate(value);
063   }
064
065   private ProxyAuthenticate(String value) {
066      super(value);
067   }
068}