imcljs.auth
basic-auth
(basic-auth service username password)
Given a username and a password return an API token
change-password
(change-password service old-password new-password)
Changes the password of an authenticated user.
create-token
(create-token service type & [options])
Create a new token. See web service documentation for more info.
delete-account
(delete-account service deregistration-token & [options])
Takes a `deregistration` token to delete the authenticated user.
deregistration
(deregistration service & [options])
Creates a deregistration token which is to be passed to `delete-account`.
login
(login service username password)
Login the user using their username and password. Returns their new API token.
If :token is present in `service`, it will get added to the Authorization header
so that the anonymously saved lists gets merged into the users account.
logout
(logout service)
Logout the authenticated user, invalidating the token provided in their
Authorization header.
oauth2authenticator
(oauth2authenticator service provider & [options])
Commence authentication for logging in using OAuth 2.0 with specified
provider. Will return a URL to redirect to the external login page.
Remember to append a `redirect_uri` parameter to the URL before redirecting.
This should be an endpoint which will be redirected to after signing in at
the third-party, passing parameters required for the `oauth2callback`.
Note that the redirect URL might be checked against a whitelist.
oauth2callback
(oauth2callback service & [options])
Complete authentication for logging in using OAuth 2.0. Requires parameters
state and code, which are received when redirecting back from the external
login service in `oauth2authenticator`, in addition to provider which should
be identical to the one passed to `oauth2authenticator`.
password-reset
(password-reset service newPassword pswResetToken & [options])
Reset the user's password using the token received from
`request-password-reset` and newPassword.
register
(register service username password & [options])
Register a new user account.
request-password-reset
(request-password-reset service email redirectUrl & [options])
Sends a password reset email to the user containing a specified redirectUrl
with a token appended as a query string.
who-am-i?
(who-am-i? service token & [options])
Given a token return user information