Authentication Service
The Webcom service that makes it possible to authenticate users and manage identities (or authentication means) of users on a Webcom application.
Instances of AuthenticationService must be built using the WebcomApplication.authenticationService property.
The first step consists in choosing an AuthenticationMethod using one of the available getXXXMethod
methods. Each subclass of AuthenticationMethod provides at least an authenticate
method, and possibly additional methods to prepare the authentication call-flow (e.g. sending a One-Time Password to the user) or manage user identities (e.g. adding and validating a new email address).
Only one user may be authenticated at a time. If two authentication call-flows are run simultaneously, one of them will be rejected.
When a user is authenticated, it overwrites the already authenticated user if any.
In order to perform a multi-factor authentication, a user must already be authenticated and Context.Current must be passed to the authenticate
method of the AuthenticationMethod associated with the additional factor. The resulting authentication factors may then be retrieved using the AuthenticationDetails.previousFactors property.
Types
Represents an authentication context.
Functions
Cancels all subscriptions previously set using the subscribe method.
Removes the account of the currently authenticated user from the Webcom Authentication service. This operation is asynchronous and calls the given callback once performed.
Removes the last identity (or authentication means) of the currently authenticated user from the Webcom Authentication service. This operation is asynchronous and calls the given callback once performed.
Creates an instance of CustomMethod to authenticate users based on a given external ad-hoc (custom) identity provider.
Creates an instance of GuestMethod to manage guest users.
Creates an instance of OAuth2Method to perform an OAuth2 authentication with a given provider from a given Android context (typically the Activity from which the authentication call-flow is to be started), using given options.
Creates an instance of OneTimePasswordMethod to manage users with a given identity provider that authenticates users based on a given user identifier (email or MSISDN) and a generated one-time password sent to the user.
Creates an instance of OrangeMobileNetworkMethod to authenticate users based on their Orange mobile data network (works only for Orange customers).
Creates an instance of PersonalPasswordMethod to manage users with a given identity provider that authenticates users based on a given identifier (email or MSISDN) and a personal password.
Subscribes to the authentication state maintained by this AuthenticationService instance and notifies the given callback function each time it changes or an authentication operation fails.
Unauthenticates the currently authenticated user. This operation is asynchronous and calls the given callback once performed.
Properties
Gives the AuthenticationDetails of the currently authenticated user or null
if no user is currently authenticated.