com.apamax.authentication
Event AuthResult


The results of an auth check against a CachedAuthentication object.
See Also:
com.apamax.authentication.CachedAuthentication#checkHeader() - This functions returns AuthResult objects.

Constant summary
 constant integerAUTH_FAILED := 0

A result of a failed authentication.
 constant integerAUTH_REQUIRED := 1

A result that authorization was not given, but is required.
 constant integerAUTH_SUCCEEDED := 4

A result that authentication has succeeded. Also provides the token, but the expectation is that the client already has it.
 constant integerNEW_TOKEN := 3

A result that authentication has succeeded, but a potentially new token has been generated and should be stored and used.
 constant integerTOKEN_EXPIRED := 2

A result with an authorization token which has expired, password authentication should now be attempted.
 
Member summary
 integerresult

The result of this auth check. Should be one of AUTH_FAILED, AUTH_REQUIRED, TOKEN_EXPIRED, NEW_TOKEN or AUTH_SUCCEEDED. AUTH_SUCCEEDED and NEW_TOKEN are success results. AUTH_REQUIRED and TOKEN_EXPIRED are temporary failure results. AUTH_FAILED is a permanent failure result.
 stringuser

The username that was authenticated (if successful).
 stringtokenHeader

A currently valid token for this user (if successful).
 
Action summary
 booleansuccess()

Returns true if this result contains a success outcome.
 
Constant detail

AUTH_FAILED

constant integer AUTH_FAILED := 0
A result of a failed authentication.

AUTH_REQUIRED

constant integer AUTH_REQUIRED := 1
A result that authorization was not given, but is required.

AUTH_SUCCEEDED

constant integer AUTH_SUCCEEDED := 4
A result that authentication has succeeded. Also provides the token, but the expectation is that the client already has it.

NEW_TOKEN

constant integer NEW_TOKEN := 3
A result that authentication has succeeded, but a potentially new token has been generated and should be stored and used.

TOKEN_EXPIRED

constant integer TOKEN_EXPIRED := 2
A result with an authorization token which has expired, password authentication should now be attempted.
Member detail

result

integer result
The result of this auth check. Should be one of AUTH_FAILED, AUTH_REQUIRED, TOKEN_EXPIRED, NEW_TOKEN or AUTH_SUCCEEDED. AUTH_SUCCEEDED and NEW_TOKEN are success results. AUTH_REQUIRED and TOKEN_EXPIRED are temporary failure results. AUTH_FAILED is a permanent failure result.

tokenHeader

string tokenHeader
A currently valid token for this user (if successful).

user

string user
The username that was authenticated (if successful).
Action detail

success

boolean success()
Returns true if this result contains a success outcome.