Skip to content
Docs

Connecting a provider that exchanges a username and password for a token

This guide is part of the Publicus connection catalog. Once you have the credentials, connect the service and Publicus stores them for you.

This is a generic guide: it describes the shape of a login that trades a username and password for a short-lived token rather than any one provider, so the account and the login’s exact form come from that provider’s own documentation.

Use it when the provider is not yet in the catalog and its API is reached by first logging in with a username and password at a login or token endpoint, which answers with a token that every later call carries.

  1. Ask the provider — or the customer’s administrator — for a dedicated integration account rather than a person’s login. Everything the connection does is done as this account, with its permissions, and it appears in the provider’s audit trail under this name.
  2. Find the provider’s authentication documentation and copy the full Token URL the credentials are posted to, what it calls the username and password fields (the defaults are username and password), and whether the request body is form-encoded or JSON.
  3. From the example answer, note which field holds the token and which holds the expiry, and how the expiry is written — seconds, a timestamp, or seconds since 1970 — or the documented lifetime if the answer carries none.
  4. Check how API calls send the token. Authorization: Bearer <token> is the default; for anything else, set Header name and Value prefix to what the provider documents.
  5. Fill the connection form, enter the username and password, and save. The connection logs in straight away, so a refused login shows as an error on the connection with the provider’s own answer.

The password is sent to the token URL and nowhere else. The token is kept by the connection and fetched again when it expires.

Open Connections under Credentials, choose Generic credential exchange, and pick Username and password exchanged for a token (any provider). Publicus asks for exactly the fields listed above and keeps them in your workspace’s secret storage.

See also: Generic credential exchange in the catalog.

This guide is maintained by Publicus and published under CC BY 4.0.