Class: State

Authentication.State

Represents a state of authentication based on the Webcom Authentication Service model.

Instances of this class are mainly provided:

Since:
  • 2.11

Members

details :Authentication.AuthenticationDetails

Specifies the authentication details of the user when Authentication.State#state is "some".

Type:

state :"none"|"some"|"required"

Specifies the state of authentication among 3 possible values:

  • "none": no user is authenticated,
  • "required": the user has lost her/his authentication before any explicit unauthentication,
  • "some": the user is authenticated, the authentication details are given by the Authentication.State#details property.
Type:
  • "none" | "some" | "required"

Methods

isAuthenticated() → {boolean}

Determines whether this instance represents a valid authentication of a user (i.e. the Authentication.State#state property equals "some").

Returns:

true if this instance represents the actual authentication of a user.

Type
boolean

isRequired() → {boolean}

Determines whether this instance represents the loss of a previous valid authentication of a user (i.e. the Authentication.State#state property equals "required").

Returns:

true if this instance represents the loss of a valid authentication of a user.

Type
boolean

isSameAs(other) → {boolean}

Tests whether this authentication state is the same as another given one.

Parameters:
Name Type Description
other Authentication.State

The other authentication state to compare with.

Returns:

true if and only if other represents the same authentication state than this instance.

Type
boolean

isUnauthenticated() → {boolean}

Determines whether this instance represents no ongoing authentication of a user (i.e. Authentication.State#state property equals "none").

Returns:

true if this instance represents the fact that no user is authenticated.

Type
boolean
show
deprecated