AbstractAuthenticationService
On this page
AbstractAuthenticationService ⇐ Abstract
Kind: global abstract class
Extends: Abstract
Service:
- AbstractAuthenticationService ⇐
Abstract- new AbstractAuthenticationService()
- instance
- .login(…args) ⇒
Promise.<*> - .logout([force]) ⇒
Promise - .invalidateLoginSync()
- .getLoginArgs() ⇒
Array.<*>|null - .getAuthOpaque() ⇒
*|null - ._login(…args) ⇒
Promise.<*> - ._logout(loginArgs, authOpaque) ⇒
Promise
- .login(…args) ⇒
- static
AbstractAuthenticationService()
Service which handles Authentication with provider’s user account.
login(…args) ⇒ Promise.<*>
Log in.
NB: Upon successful login, an event loggedIn will be emitted.
Kind: instance method of AbstractAuthenticationService
Returns: Promise.<*> - Opaque data returned by _login
| Param | Type | Description |
|---|---|---|
| ...args | any | Any useful information passed down to _login |
logout([force]) ⇒ Promise
Log out.
NB: Upon successful logout, an event loggedOut will be emitted (with data.logoutCalled === true)
Kind: instance method of AbstractAuthenticationService
| Param | Type | Description |
|---|---|---|
| [force] | boolean | Flag to force sending a logout even if successful login hasn't been done before |
invalidateLoginSync()
Invalidate login data.
NB: An event loggedOut will be emitted (with data.logoutCalled === false).
This method is synchronous.
Kind: instance method of AbstractAuthenticationService
getLoginArgs() ⇒ Array.<*> | null
Returns the login arguments or null if not logged in
Kind: instance method of AbstractAuthenticationService
getAuthOpaque() ⇒ * | null
Returns the opaque authentication data or null if not logged in
Kind: instance method of AbstractAuthenticationService
_login(…args) ⇒ Promise.<*>
Override with an implementation that performs a login challenge
Kind: instance abstract method of AbstractAuthenticationService
Returns: Promise.<*> - Opaque authentication data (e.g. token string)
Access: protected
| Param | Type | Description |
|---|---|---|
| ...args | any | Arguments passed to login |
_logout(loginArgs, authOpaque) ⇒ Promise
Implementation to logout the current connected account
Kind: instance abstract method of AbstractAuthenticationService
Access: protected
| Param | Type | Description |
|---|---|---|
| loginArgs | Array.<*> | Original login arguments used to login |
| authOpaque | * | Authentication opaque data originally returned by _login |
loggedIn
Event when login is successful
Kind: static constant of AbstractAuthenticationService
| Param |
|---|
| data.loginArgs |
| data.authOpaque |
loggedOut
Event when logout is successful
Kind: static constant of AbstractAuthenticationService
| Param |
|---|
| data.loginArgs |
| data.authOpaque |