Top Description Fields Constructors Methods
org.eclipse.jgit.internal.transport.sshd.proxy

public Class AuthenticationChallenge

extends Object
Class Inheritance
Imports
java.util.Collections, .LinkedHashMap, .Map, org.eclipse.jgit.annotations.NonNull

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

Field Summary

Modifier and TypeField and Description
private Map<String, String>
private final String
private String

Constructor Summary

AccessConstructor and Description
public
AuthenticationChallenge(String
for the challenge
mechanism
)

Create a new AuthenticationChallenge with the given mechanism.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public Map<String, String>

Returns:

a possibly empty map of the key=value arguments of the challenge
getArguments
()

Retrieves the arguments of the challenge.

public String

Returns:

the mechanism name
getMechanism
()

Retrieves the authentication mechanism specified by this challenge, for instance "Basic".

public String

Returns:

the token, or null if there is none.
getToken
()

Retrieves the token of the challenge, if any.

pack-priv void
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

argumentsback to summary
private Map<String, String> arguments
mechanismback to summary
private final String mechanism
tokenback to summary
private String token

Constructor Detail

AuthenticationChallengeback to summary
public AuthenticationChallenge(String mechanism)

Create a new AuthenticationChallenge with the given mechanism.

Parameters
mechanism:String

for the challenge

Method Detail

addArgumentback to summary
pack-priv void addArgument(String key, String value)
getArgumentsback to summary
public Map<String, String> getArguments()

Retrieves the arguments of the challenge.

Returns:Map<String, String>

a possibly empty map of the key=value arguments of the challenge

Annotations
@NonNull
getMechanismback to summary
public String getMechanism()

Retrieves the authentication mechanism specified by this challenge, for instance "Basic".

Returns:String

the mechanism name

getTokenback to summary
public String getToken()

Retrieves the token of the challenge, if any.

Returns:String

the token, or null if there is none.

setTokenback to summary
pack-priv void setToken(String token)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override