Top Description Fields Constructors Methods
waffle.util

public Class AuthorizationHeader

extends Object
Class Inheritance
Imports
java.util.Base64, .Locale, javax.servlet.http.HttpServletRequest, org.slf4j.Logger, .LoggerFactory

Authorization header.
Author
dblock[at]dblock[dot]org

Field Summary

Modifier and TypeField and Description
private static final Logger
LOGGER

The logger.

private final HttpServletRequest
request

The request.

Constructor Summary

AccessConstructor and Description
public
AuthorizationHeader(final HttpServletRequest
the http servlet request
httpServletRequest
)

Instantiates a new authorization header.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the header
getHeader
()

Gets the header.

public String

Returns:

AuthenticationScheme as SecurityPackage e.g. Negotiate, NTLM, Bearer.
getSecurityPackage
()

Returns a supported security package string.

public String

Returns:

the token
getToken
()

Gets the token.

public byte[]

Returns:

the token bytes
getTokenBytes
()

Gets the token bytes.

public boolean

Returns:

True if header contains 'BEARER' header.
isBearerAuthorizationHeader
()

Is Bearer Authorization Header will return true if 'BEARER' exists.

public boolean

Returns:

true, if is ntlm type1 message
isNtlmType1Message
()

Checks if is ntlm type1 message.

public boolean

Returns:

True if request is an NTLM POST, PUT, or DELETE with an Authorization header and no data.
isNtlmType1PostAuthorizationHeader
()

When using NTLM authentication and the browser is making a POST request, it preemptively sends a Type 2 authentication message (without the POSTed data).

public boolean

Returns:

true, if is null
isNull
()

Checks if is null.

public boolean

Returns:

true, if is SP nego message that contains NegTokenInit
isSPNegTokenInitMessage
()

Checks if is SP nego message.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

LOGGERback to summary
private static final Logger LOGGER

The logger.

requestback to summary
private final HttpServletRequest request

The request.

Constructor Detail

AuthorizationHeaderback to summary
public AuthorizationHeader(final HttpServletRequest httpServletRequest)

Instantiates a new authorization header.

Parameters
httpServletRequest:HttpServletRequest

the http servlet request

Method Detail

getHeaderback to summary
public String getHeader()

Gets the header.

Returns:String

the header

getSecurityPackageback to summary
public String getSecurityPackage()

Returns a supported security package string.

Authorization: NTLM the_token
Authorization: Negotiate the_token
Authorization: Bearer the_token
Returns:String

AuthenticationScheme as SecurityPackage e.g. Negotiate, NTLM, Bearer.

getTokenback to summary
public String getToken()

Gets the token.

Returns:String

the token

getTokenBytesback to summary
public byte[] getTokenBytes()

Gets the token bytes.

Returns:byte[]

the token bytes

isBearerAuthorizationHeaderback to summary
public boolean isBearerAuthorizationHeader()

Is Bearer Authorization Header will return true if 'BEARER' exists.

Returns:boolean

True if header contains 'BEARER' header.

isNtlmType1Messageback to summary
public boolean isNtlmType1Message()

Checks if is ntlm type1 message.

Returns:boolean

true, if is ntlm type1 message

isNtlmType1PostAuthorizationHeaderback to summary
public boolean isNtlmType1PostAuthorizationHeader()

When using NTLM authentication and the browser is making a POST request, it preemptively sends a Type 2 authentication message (without the POSTed data). The server responds with a 401, and the browser sends a Type 3 request with the POSTed data. This is to avoid the situation where user's credentials might be potentially invalid, and all this data is being POSTed across the wire.

Returns:boolean

True if request is an NTLM POST, PUT, or DELETE with an Authorization header and no data.

isNullback to summary
public boolean isNull()

Checks if is null.

Returns:boolean

true, if is null

isSPNegTokenInitMessageback to summary
public boolean isSPNegTokenInitMessage()

Checks if is SP nego message.

Returns:boolean

true, if is SP nego message that contains NegTokenInit

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override