Package org.apache.hc.client5.http.auth
Class BearerToken
- java.lang.Object
-
- org.apache.hc.client5.http.auth.BearerToken
-
- All Implemented Interfaces:
java.io.Serializable,Credentials
@Contract(threading=IMMUTABLE) public class BearerToken extends java.lang.Object implements Credentials, java.io.Serializable
Opaque tokenCredentialsusually representing a set of claims, often encrypted or signed. The JWT (JSON Web Token) is among most widely used tokens used at the time of writing.- Since:
- 5.3
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringtoken
-
Constructor Summary
Constructors Constructor Description BearerToken(java.lang.String token)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(java.lang.Object o)char[]getPassword()Deprecated.Do not use.java.lang.StringgetToken()java.security.PrincipalgetUserPrincipal()inthashCode()
-
-
-
Method Detail
-
getUserPrincipal
public java.security.Principal getUserPrincipal()
- Specified by:
getUserPrincipalin interfaceCredentials
-
getPassword
@Deprecated public char[] getPassword()
Deprecated.Do not use.- Specified by:
getPasswordin interfaceCredentials
-
getToken
public java.lang.String getToken()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-