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 * <h5 class='section'>See Also:</h5>
047 * <ul class='doctree'>
048 *    <li class='extlink'>{@doc RFC2616}
049 * </ul>
050 */
051@Header("Proxy-Authenticate")
052public final class ProxyAuthenticate extends HeaderString {
053
054   /**
055    * Returns a parsed <code>Proxy-Authenticate</code> header.
056    *
057    * @param value The <code>Proxy-Authenticate</code> header string.
058    * @return The parsed <code>Proxy-Authenticate</code> header, or <jk>null</jk> if the string was null.
059    */
060   public static ProxyAuthenticate forString(String value) {
061      if (value == null)
062         return null;
063      return new ProxyAuthenticate(value);
064   }
065
066   private ProxyAuthenticate(String value) {
067      super(value);
068   }
069}