Class: AuthenticationService

AuthenticationService

Exposes the functions and constants of the Webcom Authentication service.

Since:
  • 2.11

Classes

State

Members

(readonly) currentState :AuthenticationService.State

The current authentication state.
Note: When working together with a DatasyncService that uses this AuthenticationService instance, this property is slightly delayed wrt. DatasyncService.currentState. If you need a real time value, rather use the latter property.

Type:

Type Definitions

authCallback(errornullable, authnullable)

A callback function that is called when the authentication state changes.

Parameters:
Name Type Attributes Description
error Error <nullable>

If not null, indicates that the last authentication-related operation failed. This object is provided with the following properties:

Properties
Name Type Description
code String

A machine-readable code that identifies the error.

message String

A human-readable description of the error.

auth AuthenticationService.AuthenticationDetails <nullable>

Relevant only when error is null.
If null, no user is currently authenticated (typically resulting from the previously authenticated user signing out), otherwise, this object describes the current authenticated user details.

See:

AuthenticationDetails

Provides all the attributes of a succeeded authentication, following the model of the Webcom Authentication Service.

Type:
  • Object
Properties:
Name Type Attributes Description
webcomAuthToken string

The authentication token

expires number

The expiration date of the authentication (in seconds since the Unix epoch)

uid string

Webcom account unique identifier

provider string

The authentication provider

providerUid string

Account uid from the 3rd-party provider

providerProfile Object <optional>

Provider-specific data about the account provided by the 3rd-party provider

extra Object <optional>

Additional provider-specific data that will be not saved within the local storage. They typically include sensitive pieces of information such as access token.

Since:
  • 2.11
See:
show
deprecated