public class AuthorizationHeader
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AUTH_SCHEME_BASIC |
static java.lang.String |
AUTH_SCHEME_BEARER |
static java.lang.String |
AUTH_SCHEME_DIGEST |
Constructor and Description |
---|
AuthorizationHeader() |
AuthorizationHeader(java.lang.String authScheme,
java.lang.String authData) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
asHeaderString()
Returns the full request header name and value.
|
java.lang.String |
asString()
Returns the auth-scheme together with the auth-data separated by a space.
|
java.lang.String |
getAuthData()
Returns the authentication data that was provided with the authentication scheme.
|
java.lang.String |
getAuthScheme() |
boolean |
isAuthScheme(java.lang.String name)
Returns true if the underlying authentication scheme equals (case-insensitive)
the given name.
|
boolean |
isBasicAuthScheme() |
boolean |
isBearerAuthScheme() |
boolean |
isDigestAuthScheme() |
void |
setAuthData(java.lang.String authData) |
void |
setAuthScheme(java.lang.String authScheme) |
public static final java.lang.String AUTH_SCHEME_BASIC
public static final java.lang.String AUTH_SCHEME_DIGEST
public static final java.lang.String AUTH_SCHEME_BEARER
public AuthorizationHeader()
public AuthorizationHeader(java.lang.String authScheme, java.lang.String authData)
public java.lang.String getAuthScheme()
public java.lang.String getAuthData()
public void setAuthScheme(java.lang.String authScheme)
public void setAuthData(java.lang.String authData)
public boolean isBasicAuthScheme()
public boolean isDigestAuthScheme()
public boolean isBearerAuthScheme()
public boolean isAuthScheme(java.lang.String name)
name
- The (auth scheme) name to check against.public java.lang.String asString()
Example: "Basic emda8ghk823fvdcs99sJSst="
public java.lang.String asHeaderString()
Example: "Authorization: Bearer e8785jAp9dnSNo/Twqpds8a7w4j="