Class Challenge


  • public final class Challenge
    extends java.lang.Object
    This class represents an RFC 7235 authentication challenge.
    • Constructor Summary

      Constructors 
      Constructor Description
      Challenge​(java.lang.String scheme, java.util.Map<java.lang.String,​java.lang.String> authParams)
      Creates a new challenge.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.util.Map<java.lang.String,​java.lang.String> getAuthParams()
      Gets the auth params, including realm if present, but as Strings.
      java.util.Optional<java.lang.String> getRealm()
      Returns the protection space.
      java.lang.String getScheme()
      Gets the authentication scheme in lowercase, like basic.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Challenge

        public Challenge​(java.lang.String scheme,
                         java.util.Map<java.lang.String,​java.lang.String> authParams)
        Creates a new challenge.
        Parameters:
        scheme - The authentication scheme for this challenge.
        authParams - The auth params for this challenge.
    • Method Detail

      • getScheme

        public java.lang.String getScheme()
        Gets the authentication scheme in lowercase, like basic.
        Returns:
        The authentication scheme.
      • getAuthParams

        public java.util.Map<java.lang.String,​java.lang.String> getAuthParams()
        Gets the auth params, including realm if present, but as Strings. The keys are all lowercase, as the auth param names are to be treated case insensitively anyway. If a challenge uses the token68 form instead of the auth params form, there is exactly one entry in the result where the key is null and the value is the token.
        Returns:
        The auth params.
      • getRealm

        public java.util.Optional<java.lang.String> getRealm()
        Returns the protection space.
        Returns:
        The protection space.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object