Class: AuthenticationClient

Authentication Client

The Authentication Client supports three distinct areas of functionality:

1) The client API provides hooks for plugging in a custom sign-on component at the beginning of Finsemble start-up (before application-level components are started). See the Authentication tutorial for an overview of using these hooks.

2) The client API provides hooks for running authentication processes dynamically via "authentication profiles."

3) The client API provides automatic login capabilities for Finsemble components (password auto-fill).

Methods

appAcceptSignOn
(signOnKey)
clients/authenticationClient.js, line 121

ALPHA Automatic SignOn Function. Accepts the data returned by appSignOn, causing the data to be saved for future use. Should only be called when validationRequired is true in sign-on response.

Name Type Description
signOnKey any

appRejectAndRetrySignOn
(signOnKey, params, cb)
clients/authenticationClient.js, line 106

ALPHA Automatic SignOn Function. Rejects previous sign-on data and restarts sign on. Returns the sign-on data after either prompting user or getting a cached version. Should only be called when validationRequired is true in sign-on response.

Name Type Description
signOnKey any
params object

object { userMsg } where userMsg is an option message to be displayed for user in sign`on dialog

cb any

appRejectSignOn
(signOnKey)
clients/authenticationClient.js, line 132

ALPHA Automatic SignOn Function. Rejects the data returned by previous sign on. Should only be called when validationRequired is true in sign-on response.

Name Type Description
signOnKey any

appSignOn
(signOnKey, params, cb)
clients/authenticationClient.js, line 88

ALPHA Automatic SignOn Function. Returns the signon data after either prompting user or getting a cached version.

Name Type Description
signOnKey string

component-defined unique identifier string representing the sign-on data (the same string must be used for each unique signon).

params object

object { icon, prompt, force, userMsg }. icon is a URL to icon to displace in sign-on dialog. prompt is a string to display in signon dialog. force indicates if sign-on dialog should be used even if accepted sign-on data is available in the encrypted store. userMsg is an optional message to be displayed for the user in the sign-on dialog.

cb function

callback function (err,response) with the response being an object: { signOnKey, username, password, validationRequired }

beginAuthentication
(params, cb)
clients/authenticationClient.js, line 197

Starts an authentication process. The callback will be triggered when the authentication is totally complete. Use this method if you have a component that needs to complete an authentication process, such as OAuth2.

You must set up an "authentication profile" in your Finsemble config. Reference the name of that profile in params.profile. See the Authentication Tutorial for information on configuration authentication profiles.

Since:
  • TBD
Name Type Description
params object
Name Type Description
profile string

The name of the authentication profile from the authentication config section. See "startup" for instance.

spawnParams object optional

Optionally specify parameters to send to spawn, for when spawning an authentication window.

cb function

Returns an object containing the authentication response, i.e., OAuth credentials, etc

completeOAUTH
(params, cb)
clients/authenticationClient.js, line 148

Completes an OAuth2 authentication that was begun with AuthenticationClient#beginAuthentication. This function is called when an OAuth2 response is completed. You should call this function from within the page that you specified in "redirect_uri" in your Authentication Profile config. See the authentication tutorial for more information on configuring OAuth.

Since:
  • TBD
Name Type Description
params object optional

Optionally pass the OAuth2 query string parameters from your response page. Set to null and the query string will automatically be parsed based on the OAuth2 specification.

cb function

Returns the result (err, data). data will contain the results of the authentication process, such as the access_token and other values provided by your Identify Provider.

getCurrentCredentials
(cb)
clients/authenticationClient.js, line 61

Returns the current global credentials (as published through AuthenticationClient#publishAuthorization) or null if no credentials are set yet.

Since:
  • TBD
Name Type Description
cb function

A function that returns the current credentials. Will return null/undefined if no credentials have yet been established.

publishAuthorization
(user, credentials)
clients/authenticationClient.js, line 47

During Finsemble's start-up process, this function must be invoked before Finsemble will start the application. Once invoked, the authenticated user name and authorization credentials are received by the Authentication Service and published on the "AuthenticationService.authorization" channel. Any component can revieve the credentials by subscribing to that channel or by calling AuthenticationClient#getCurrentCredentials.

Note that all calls to Storage Client are keyed to the authenticated user. See StorageClient#setUser. If authentication is not enabled, then "defaultUser" is used instead.

Name Type Description
user string

the name of the authenticated user

credentials object

the authorization credentials (or token) for the current user, as specified by the application's authentication component.

Example
FSBL.Clients.AuthenticationClient.publishAuthorization(username, credentials);

transmitSignOnToAuthService
(signOnData)
clients/authenticationClient.js, line 73

ALPHA Automatic SignOn Function. Not used by components signing on, but only by "system dialog" component that prompts the user for signon data. This command will send the user-input sign-on data back to the Authentication Service.

Name Type Description
signOnData any