Package org.javacord.api.util.auth
Class Challenge
- java.lang.Object
-
- org.javacord.api.util.auth.Challenge
-
public final class Challenge extends java.lang.ObjectThis 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 booleanequals(java.lang.Object o)java.util.Map<java.lang.String,java.lang.String>getAuthParams()Gets the auth params, includingrealmif present, but asStrings.java.util.Optional<java.lang.String>getRealm()Returns the protection space.java.lang.StringgetScheme()Gets the authentication scheme in lowercase, likebasic.inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getScheme
public java.lang.String getScheme()
Gets the authentication scheme in lowercase, likebasic.- Returns:
- The authentication scheme.
-
getAuthParams
public java.util.Map<java.lang.String,java.lang.String> getAuthParams()
Gets the auth params, includingrealmif present, but asStrings. The keys are all lowercase, as the auth param names are to be treated case insensitively anyway. If a challenge uses thetoken68form instead of the auth params form, there is exactly one entry in the result where the key isnulland 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-