Class AuthenticateChallenge

java.lang.Object
com.azure.core.util.AuthenticateChallenge

public final class AuthenticateChallenge extends Object
An authenticate challenge.

This challenge can be from any source, but will primarily be from parsing HttpHeaderName.WWW_AUTHENTICATE or HttpHeaderName.PROXY_AUTHENTICATE headers using CoreUtils.parseAuthenticateHeader(String).

Some challenge information may be optional, meaning the getters may return null or an empty collection.

  • Constructor Details

    • AuthenticateChallenge

      public AuthenticateChallenge(String scheme)
      Creates an instance of the AuthenticateChallenge.
      Parameters:
      scheme - The scheme of the challenge.
      Throws:
      IllegalArgumentException - If the scheme is null or empty.
    • AuthenticateChallenge

      public AuthenticateChallenge(String scheme, String token68)
      Creates an instance of the AuthenticateChallenge.
      Parameters:
      scheme - The scheme of the challenge.
      token68 - The token68 of the challenge.
      Throws:
      IllegalArgumentException - If the scheme is null or empty.
    • AuthenticateChallenge

      public AuthenticateChallenge(String scheme, Map<String,String> parameters)
      Creates an instance of the AuthenticateChallenge.
      Parameters:
      scheme - The scheme of the challenge.
      parameters - The parameters of the challenge.
      Throws:
      IllegalArgumentException - If the scheme is null or empty.
  • Method Details

    • getScheme

      public String getScheme()
      Gets the scheme of the challenge.
      Returns:
      The scheme of the challenge.
    • getParameters

      public Map<String,String> getParameters()
      Gets the parameters of the challenge as a read-only map.

      This map will be empty if the challenge does not have any parameters.

      Returns:
      The parameters of the challenge.
    • getToken68

      public String getToken68()
      Gets the token68 of the challenge.

      This may be null if the challenge does not have a token68.

      Returns:
      The token68 of the challenge, or null if the challenge does not have a token68.