Docs
On this page
reference2 min readApplication: Platform Integration

Outbound credentials

The token types, OAuth provider fields and token fields Servicely uses to store credentials for calling other systems.

Servicely stores the credentials it uses to call other systems in System API Outbound Token records, and OAuth2 settings in System OAuth Provider records. Use this page to look up a token type or a field while you set up an outbound integration.

How to read this page

One OAuth provider can serve several tokens. For example, one provider for a cloud service can back one token per account or per service. Every other token type stands alone. A server script uses a token by name: pass it to the apiTokenAuth method of any outbound HTTP request. Servicely applies the credentials before it sends the request and refreshes an expired OAuth2 token first.

Both records are under Administration → Integration: System API outbound tokens and System OAuth providers.

Token types

The Type field decides which credential fields the token form shows.

Type Fields the form shows Purpose
OAuth2 OAuth Provider, Scopes, OAuth Prompt, OAuth Provider Parameters, State, Expires, Last message Obtains and refreshes access tokens from an OAuth2 provider
HMAC Body (Servicely) Access Key / Token, Secret Key Signs requests to another Servicely instance with that instance’s System API token and shared secret
Bearer Access Key / Token Sends a static bearer token
Basic User name, Password Sends a username and password with basic authentication
Access Key Access Key / Token, Secret Key Stores an access key and secret key pair
Middleware HMAC No type-specific fields Signs the request body with HMAC-SHA256 and sends the signature in the X-Servicely-Signature header, for middleware such as a Node-RED bridge
Custom Custom Mappings Applies credentials through custom mappings

Basic and bearer credentials give no protection beyond the transport. Prefer OAuth2 or HMAC where the other system supports them.

Token fields

These fields appear on every token, whatever its type.

Field Type Required Behaviour Purpose
Name String No Scripts refer to the token by this value Identifies the token
Type Choice No Changing it changes the fields shown Sets the credential type
Active Boolean No A cleared token is not used Turns the token off without deleting it
Base URL URL No Informational only Records which system the token is for
Description Text No Notes for administrators

OAuth2 token fields

Field Type Required Behaviour Purpose
OAuth Provider Reference For OAuth2 Shown for OAuth2 only The provider whose endpoints and client the token uses
Scopes Text No Overrides the provider’s scopes The scopes requested for this token
OAuth Prompt Choice No Defaults to consent The prompt value sent to the provider: consent, select_account, login or none
OAuth Provider Parameters Properties No Values replace placeholders such as {tenant} in the provider’s URLs and scopes Lets one provider serve several tenants
State Choice System-set Updated as the token moves through authorisation Shows whether the token is usable
Expires Date and time System-set Set when the provider returns an expiry When the access token expires
Last message Text System-set Holds the last error from the provider Explains a failed request or refresh
OAuth Access Token, OAuth Refresh Token Encrypted System-set Stored encrypted The tokens returned by the provider

Some providers need a different prompt at different times. For example, use consent while an administrator grants permissions, then select_account when an ordinary user signs in.

State Meaning
New The token has not been authorised
Awaiting auth token Servicely is waiting for the provider’s authorisation response
Awaiting access token Servicely is exchanging the authorisation code for an access token
Ready The token can be used
Awaiting refresh token Servicely is refreshing the access token
Error The last request or refresh failed. See Last message.
Expired The access token has expired and was not refreshed

OAuth provider fields

Field Type Required Behaviour Purpose
Name String No Identifies the provider
Client ID String Yes Supplied by the provider The client the provider registered for Servicely
Client Secret Encrypted Yes Stored encrypted The client’s shared secret
Grant type Choice No Authorization Code or Client Credentials The OAuth2 flow Servicely uses
Authorization URL URL No The browser is sent here to sign in Starts the authorisation flow
Token URL URL No Servicely calls it directly Exchanges codes and refreshes tokens
Redirect URL URL No Register https://<your-instance>/sso/oauth_callback/ with the provider Where the provider returns the browser
Token Revocation URL URL No Revokes tokens at the provider
Scopes Text No Tokens can override them The default scopes requested
Authentication Method Choice No Basic Auth or Request Body How the client credentials are sent to the token URL
Provider Kind String No Must match a registered health check, for example entra Chooses the check that Test Connection runs
Description Text No Notes for administrators
Grant type Token refresh
Authorization Code A user signs in once. Servicely stores the access and refresh tokens and refreshes them before they expire.
Client Credentials Servicely requests a new access token from the client ID and secret when the current one expires. No user signs in.

The refresh job picks up Authorization Code tokens that expire within system.token_refresh.window_minutes minutes. The default is 5.

Last updated 24 November 2026commit 88e011e506a8Chris Jones
Back to top