public class BasicAuthScheme extends Object implements AuthScheme
Modifier and Type | Field and Description |
---|---|
static BasicAuthScheme |
INSTANCE
Sole instance.
|
Modifier and Type | Method and Description |
---|---|
ContextFactory |
createContextFactory(Challenge challenge,
URL url)
Attempts to return an object that can take user input to generate
an AuthContext based on a given challenge.
|
static String |
encodeUserPass(String user,
char[] pass)
Encodes the user:password pair as a Base64-encoded string,
as described by RFC 7617.
|
String |
getName()
Returns a human-readable name identifying the authentication
scheme implemented by this object.
|
public static final BasicAuthScheme INSTANCE
public String getName()
AuthScheme
auth-scheme
token from an RFC7235 challenge (for instance "Basic" for Basic
authentication), but a different value may be used if required
to distinguish it from other instances.getName
in interface AuthScheme
public ContextFactory createContextFactory(Challenge challenge, URL url) throws BadChallengeException
AuthScheme
Note that this method should just examine the syntax of the supplied challenge; it is not expected to make network connections etc to determine if context creation will be successful.
createContextFactory
in interface AuthScheme
challenge
- authentication challenge objecturl
- URL with which the challenge is associatedBadChallengeException
- if the challenge scheme etc
indicates that it is destined for this AuthScheme,
but the challenge is not of the correct formCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.