forio Toggle navigation

Authentication API Service

The Authentication API Service provides a method for logging in, which creates and returns a user access token.

User access tokens are required for each call to Epicenter. (See Project Access for more information.)

If you need additional functionality -- such as tracking session information, easily retrieving the user token, or getting the groups to which an end user belongs -- consider using the Authorization Manager instead.

 var auth = new F.service.Auth();
 auth.login({ userName: 'jsmith@acmesimulations.com',
             password: 'passw0rd' });

Configuration Options

userName

  • String

Email or username to use for logging in. Defaults to empty string.

password

  • String

Password for specified userName. Defaults to empty string.

account

  • String

The account id for this userName. In the Epicenter UI, this is the Team ID (for team projects) or the User ID (for personal projects). Required if the userName is for an end user. Defaults to empty string.

transport

  • Object

Options to pass on to the underlying transport layer. All jquery.ajax options at http://api.jquery.com/jQuery.ajax/ are available. Defaults to empty object.

Methods

login

Logs user in, returning the user access token.

If no userName or password were provided in the initial configuration options, they are required in the options here. If no account was provided in the initial configuration options and the userName is for an end user, the account is required as well.

Example

 auth.login({
     userName: 'jsmith',
     password: 'passw0rd',
     account: 'acme-simulations' })
 .then(function (token) {
     console.log("user access token is: ", token.access_token);
 });

Parameters

  • options: Object (Optional) Overrides for configuration options.