Package waffle.util
Class AuthorizationHeader
java.lang.Object
waffle.util.AuthorizationHeader
Authorization header.
-
Constructor Summary
ConstructorDescriptionAuthorizationHeader
(javax.servlet.http.HttpServletRequest httpServletRequest) Instantiates a new authorization header. -
Method Summary
Modifier and TypeMethodDescriptionGets the header.Returns a supported security package string.getToken()
Gets the token.byte[]
Gets the token bytes.boolean
Is Bearer Authorization Header will return true if 'BEARER' exists.boolean
Checks if is ntlm type1 message.boolean
When using NTLM authentication and the browser is making a POST request, it preemptively sends a Type 2 authentication message (without the POSTed data).boolean
isNull()
Checks if is null.boolean
Checks if is SP nego message.toString()
-
Constructor Details
-
AuthorizationHeader
public AuthorizationHeader(javax.servlet.http.HttpServletRequest httpServletRequest) Instantiates a new authorization header.- Parameters:
httpServletRequest
- the http servlet request
-
-
Method Details
-
getHeader
Gets the header.- Returns:
- the header
-
isNull
public boolean isNull()Checks if is null.- Returns:
- true, if is null
-
getSecurityPackage
Returns a supported security package string.Authorization: NTLM the_token Authorization: Negotiate the_token Authorization: Bearer the_token
- Returns:
- AuthenticationScheme as SecurityPackage e.g. Negotiate, NTLM, Bearer.
-
toString
-
getToken
Gets the token.- Returns:
- the token
-
getTokenBytes
public byte[] getTokenBytes()Gets the token bytes.- Returns:
- the token bytes
-
isNtlmType1Message
public boolean isNtlmType1Message()Checks if is ntlm type1 message.- Returns:
- true, if is ntlm type1 message
-
isSPNegTokenInitMessage
public boolean isSPNegTokenInitMessage()Checks if is SP nego message.- Returns:
- true, if is SP nego message that contains NegTokenInit
-
isNtlmType1PostAuthorizationHeader
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:
- True if request is an NTLM POST, PUT, or DELETE with an Authorization header and no data.
-
isBearerAuthorizationHeader
public boolean isBearerAuthorizationHeader()Is Bearer Authorization Header will return true if 'BEARER' exists.- Returns:
- True if header contains 'BEARER' header.
-