Authentication
Consumer Element Authentication
Consumer Elements are public facing, and therefore are accessible without generating an API token via the API. Instead OnSched.js requires a clientId
in the OnSched function when initializing the SDK.
const client_id = 'DemoUser';
const init_options = {};
const onsched = OnSched(client_id, init_options);
When using this method of authentication you must also validate the domain where your application will be used, to do so please follow the Domain Validation steps below
Setup Element Authentication
Setup Elements require a valid API token. This validation has been added to protect OnSched.js users from having access to Admin/Setup functionality without explicit authentication against the OnSched Identity API.
Once you have a Bearer token you may include it in the initialization options object as a value for the property access_token:
const client_id = 'DemoUser';
const init_options = {
access_token: '', // JWT Bearer token gathered from https://sandbox-identity.onsched.com/connect/token
};
const onsched = OnSched(client_id, init_options);
To generate an access_token, please follow the OnSched Rest API Authentication steps.
Domain Validation
If no access_token is provided, OnSched.js validates the domains entered in the APISettings tab of the Dashboard. This a valid option for all Consumer Elements. We then authenticate for you when you call the initialization function described in the Initialization section of the OnSched.js documentation.
In order to add new qualified domains navigate to the API settings tab in the Dashboard:
Updated about 1 year ago