Class BasicSchemeFactory
- java.lang.Object
-
- org.apache.hc.client5.http.impl.auth.BasicSchemeFactory
-
- All Implemented Interfaces:
AuthSchemeFactory
@Contract(threading=STATELESS) public class BasicSchemeFactory extends java.lang.Object implements AuthSchemeFactory
AuthSchemeFactoryimplementation that creates and initializesBasicSchemeinstances.- Since:
- 4.0
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.charset.Charsetcharsetstatic BasicSchemeFactoryINSTANCEDefault instance ofwith a null Charset.
-
Constructor Summary
Constructors Constructor Description BasicSchemeFactory()Constructs a newBasicSchemeFactorywithStandardCharsets.UTF_8as the charset.BasicSchemeFactory(java.nio.charset.Charset charset)Deprecated.This constructor is deprecated to enforce the use ofStandardCharsets.UTF_8encoding in compliance with RFC 7617 for HTTP Basic Authentication.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AuthSchemecreate(org.apache.hc.core5.http.protocol.HttpContext context)Creates an instance ofAuthScheme.
-
-
-
Field Detail
-
INSTANCE
public static final BasicSchemeFactory INSTANCE
Default instance ofwith a null Charset.
-
charset
private final java.nio.charset.Charset charset
-
-
Constructor Detail
-
BasicSchemeFactory
@Deprecated public BasicSchemeFactory(java.nio.charset.Charset charset)
Deprecated.This constructor is deprecated to enforce the use ofStandardCharsets.UTF_8encoding in compliance with RFC 7617 for HTTP Basic Authentication. Use the default constructorBasicSchemeFactory()instead.- Parameters:
charset- theCharsetset to be used for encoding credentials. This parameter is ignored as UTF-8 is always used.
-
BasicSchemeFactory
public BasicSchemeFactory()
Constructs a newBasicSchemeFactorywithStandardCharsets.UTF_8as the charset. This default setting aligns with standard practices for encoding credentials in Basic Authentication.
-
-
Method Detail
-
create
public AuthScheme create(org.apache.hc.core5.http.protocol.HttpContext context)
Description copied from interface:AuthSchemeFactoryCreates an instance ofAuthScheme.- Specified by:
createin interfaceAuthSchemeFactory- Returns:
- auth scheme.
-
-