fun subscribe(callback: AuthenticationCallback): AuthenticationSubscription
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.
Note that when an authentication error occurs, it is notified to the callback function but it doesn't affect the current authentication state: if no user was authenticated, then no user is still authenticated; if a user was authenticated, then the same user is still authenticated with the same authentication details.
Each subscription can be explicitly cancelled using the AuthenticationSubscription.cancel method. It will be also implicitly cancelled at the disposal of this AuthenticationService instance.