/** * Parse the HTTP Authorization header for BASIC authentication * as per RFC 2617 section 2, and the Base64 encoded credentials * as per RFC 2045 section 6.8. * * @param input The header value to parse in-place * @param charset The character set to use to convert the bytes to a * string * * @throws IllegalArgumentException If the header does not conform * to RFC 2617 */ public BasicCredentials(ByteChunk input, Charset charset) throws IllegalArgumentException { authorization = input; initialOffset = input.getOffset(); this.charset = charset; parseMethod(); byte[] decoded = parseBase64(); parseCredentials(decoded); }
/** * Parse the HTTP Authorization header for BASIC authentication * as per RFC 2617 section 2, and the Base64 encoded credentials * as per RFC 2045 section 6.8. * * @param input The header value to parse in-place * * @throws IllegalArgumentException If the header does not conform * to RFC 2617 */ public BasicCredentials(ByteChunk input) throws IllegalArgumentException { authorization = input; initialOffset = input.getOffset(); parseMethod(); byte[] decoded = parseBase64(); parseCredentials(decoded); }
/** * Parse the HTTP Authorization header for BASIC authentication * as per RFC 2617 section 2, and the Base64 encoded credentials * as per RFC 2045 section 6.8. * * @param input The header value to parse in-place * @param charset The character set to use to convert the bytes to a * string * * @throws IllegalArgumentException If the header does not conform * to RFC 2617 */ public BasicCredentials(ByteChunk input, Charset charset) throws IllegalArgumentException { authorization = input; initialOffset = input.getOffset(); this.charset = charset; parseMethod(); byte[] decoded = parseBase64(); parseCredentials(decoded); }