Class: Auth

Auth

new Auth(domain)

Parameters:
Name Type Description
domain string The project domain
Source:

Methods

authenticate(grant_type, email, password, refresh_token)

This OAuth2 compliant endpoint can be used both create new authorization tokens or to refresh an existing ones. There are three types of authorization tokens provided by this endpoint.

Access token
The access token is used to authorize requests on your 28.io account. These methods are currently unstable and are not documented yet.
Refresh Token
This token is used to renew the validity of your current authorization tokens.
Project token
This token is used to authorize requests to a 28.io project. For instance, the project token named myproject can be used to authorize any request to the http://myproject.28.io endpoint.

Any successful request to this endpoint will return the access, refresh, and project tokens.

To create new authorization tokens, the grant_type parameter must be set to client_credentials and the email. The password parameters must be specified as well.

To refresh the validity of your authorized tokens, the grant_type parameter must be set to refresh_token and the refresh_token parameter must be specified. In this scenario, new authorization tokens will be granted.

The format of the expiration date of a token is ISO 8601 compliant.

Parameters:
Name Type Description
grant_type string Authorization grant type. Use client_credentials to create a token or refresh_token to refresh a token,
email string The account email. Mandatory if grant_type=client_credentials.,
password string The account password. Mandatory if grant_type=client_credentials.,
refresh_token string The refresh_token obtained in the last successful request to this endpoint. Mandatory if grant_type=refresh_token.,
Source: