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
015/**
016 * Represents a parsed <l> Proxy-Authenticate</l> HTTP response header.
017 * 
018 * <p>
019 * Request authentication to access the proxy.
020 * 
021 * <h5 class='figure'>Example</h5>
022 * <p class='bcode'>
023 *    Proxy-Authenticate: Basic
024 * </p>
025 * 
026 * <h5 class='topic'>RFC2616 Specification</h5>
027 * 
028 * The Proxy-Authenticate response-header field MUST be included as part of a 407 (Proxy Authentication Required)
029 * response.
030 * The field value consists of a challenge that indicates the authentication scheme and parameters applicable to the
031 * proxy for this Request-URI.
032 * 
033 * <p class='bcode'>
034 *    Proxy-Authenticate  = "Proxy-Authenticate" ":" 1#challenge
035 * </p>
036 * 
037 * <p>
038 * The HTTP access authentication process is described in "HTTP Authentication: Basic and Digest Access Authentication".
039 * Unlike WWW-Authenticate, the Proxy-Authenticate header field applies only to the current connection and SHOULD NOT
040 * be passed on to downstream clients.
041 * However, an intermediate proxy might need to obtain its own credentials by requesting them from the downstream
042 * client, which in some circumstances will appear as if the proxy is forwarding the Proxy-Authenticate header field.
043 * 
044 * <h5 class='section'>See Also:</h5>
045 * <ul class='doctree'>
046 *    <li class='extlink'><a class='doclink' href='https://www.w3.org/Protocols/rfc2616/rfc2616.html'>Hypertext Transfer Protocol -- HTTP/1.1</a>
047 * </ul>
048 */
049public final class ProxyAuthenticate extends HeaderString {
050
051   /**
052    * Returns a parsed <code>Proxy-Authenticate</code> header.
053    * 
054    * @param value The <code>Proxy-Authenticate</code> header string.
055    * @return The parsed <code>Proxy-Authenticate</code> header, or <jk>null</jk> if the string was null.
056    */
057   public static ProxyAuthenticate forString(String value) {
058      if (value == null)
059         return null;
060      return new ProxyAuthenticate(value);
061   }
062
063   private ProxyAuthenticate(String value) {
064      super(value);
065   }
066}