@Contract(threading=STATELESS) public class BasicSchemeFactory extends Object implements AuthSchemeFactory
AuthSchemeFactory
implementation that creates and initializes
BasicScheme
instances.Modifier and Type | Field and Description |
---|---|
static BasicSchemeFactory |
INSTANCE
Default instance of
with a null Charset . |
Constructor and Description |
---|
BasicSchemeFactory()
Constructs a new
BasicSchemeFactory with StandardCharsets.UTF_8 as the charset. |
BasicSchemeFactory(Charset charset)
Deprecated.
This constructor is deprecated to enforce the use of
StandardCharsets.UTF_8 encoding
in compliance with RFC 7617 for HTTP Basic Authentication. Use the default constructor BasicSchemeFactory() instead. |
Modifier and Type | Method and Description |
---|---|
AuthScheme |
create(org.apache.hc.core5.http.protocol.HttpContext context)
Creates an instance of
AuthScheme . |
public static final BasicSchemeFactory INSTANCE
with a null Charset
.@Deprecated public BasicSchemeFactory(Charset charset)
StandardCharsets.UTF_8
encoding
in compliance with RFC 7617 for HTTP Basic Authentication. Use the default constructor BasicSchemeFactory()
instead.charset
- the Charset
set to be used for encoding credentials. This parameter is ignored as UTF-8 is always used.public BasicSchemeFactory()
BasicSchemeFactory
with StandardCharsets.UTF_8
as the charset.
This default setting aligns with standard practices for encoding credentials in Basic Authentication.public AuthScheme create(org.apache.hc.core5.http.protocol.HttpContext context)
AuthSchemeFactory
AuthScheme
.create
in interface AuthSchemeFactory
Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.