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-Authorization</l> HTTP request header. 017 * 018 * <p> 019 * Authorization credentials for connecting to a proxy. 020 * 021 * <h5 class='figure'>Example</h5> 022 * <p class='bcode'> 023 * Proxy-Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== 024 * </p> 025 * 026 * <h5 class='topic'>RFC2616 Specification</h5> 027 * 028 * The Proxy-Authorization request-header field allows the client to identify itself (or its user) to a proxy which 029 * requires authentication. 030 * The Proxy-Authorization field value consists of credentials containing the authentication information of the user 031 * agent for the proxy and/or realm of the resource being requested. 032 * 033 * <p class='bcode'> 034 * Proxy-Authorization = "Proxy-Authorization" ":" credentials 035 * </p> 036 * 037 * <p> 038 * The HTTP access authentication process is described in "HTTP Authentication: Basic and Digest Access Authentication". 039 * Unlike Authorization, the Proxy-Authorization header field applies only to the next outbound proxy that demanded 040 * authentication using the Proxy-Authenticate field. 041 * When multiple proxies are used in a chain, the Proxy-Authorization header field is consumed by the first outbound 042 * proxy that was expecting to receive credentials. 043 * A proxy MAY relay the credentials from the client request to the next proxy if that is the mechanism by which the 044 * proxies cooperatively authenticate a given request. 045 * 046 * <h5 class='section'>See Also:</h5> 047 * <ul class='doctree'> 048 * <li class='extlink'><a class='doclink' href='https://www.w3.org/Protocols/rfc2616/rfc2616.html'>Hypertext Transfer Protocol -- HTTP/1.1</a> 049 * </ul> 050 */ 051public final class ProxyAuthorization extends HeaderString { 052 053 /** 054 * Returns a parsed <code>Proxy-Authorization</code> header. 055 * 056 * @param value The <code>Proxy-Authorization</code> header string. 057 * @return The parsed <code>Proxy-Authorization</code> header, or <jk>null</jk> if the string was null. 058 */ 059 public static ProxyAuthorization forString(String value) { 060 if (value == null) 061 return null; 062 return new ProxyAuthorization(value); 063 } 064 065 private ProxyAuthorization(String value) { 066 super(value); 067 } 068}