Class AuthenticationChallenge
- java.lang.Object
-
- org.eclipse.jgit.internal.transport.sshd.proxy.AuthenticationChallenge
-
public class AuthenticationChallenge extends Object
A simple representation of an authentication challenge as sent in a "WWW-Authenticate" or "Proxy-Authenticate" header. Such challenges start with a mechanism name, followed either by one single token, or by a list of key=value pairs.- See Also:
- RFC 7235, sec. 2.1
-
-
Constructor Summary
Constructors Constructor Description AuthenticationChallenge(String mechanism)
Create a newAuthenticationChallenge
with the given mechanism.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,String>
getArguments()
Retrieves the arguments of the challenge.String
getMechanism()
Retrieves the authentication mechanism specified by this challenge, for instance "Basic".String
getToken()
Retrieves the token of the challenge, if any.String
toString()
-
-
-
Constructor Detail
-
AuthenticationChallenge
public AuthenticationChallenge(String mechanism)
Create a newAuthenticationChallenge
with the given mechanism.- Parameters:
mechanism
- for the challenge
-
-
Method Detail
-
getMechanism
public String getMechanism()
Retrieves the authentication mechanism specified by this challenge, for instance "Basic".- Returns:
- the mechanism name
-
getToken
public String getToken()
Retrieves the token of the challenge, if any.- Returns:
- the token, or
null
if there is none.
-
getArguments
@NonNull public Map<String,String> getArguments()
Retrieves the arguments of the challenge.- Returns:
- a possibly empty map of the key=value arguments of the challenge
-
-