Token Authentication

How to send data using token based authentication.

As an alternative to using SSL certificates or an API Key for authentication when sending data to the /datafeed endpoint, you can use a JSON Web Token . Using a token for authentication requires that Stroom or Stroom-Proxy have been configured with identityProviderType set to EXTERNAL_IDP (see External IDP for details on the configuration for an external IDP and how to generate a token).

To attach a token to the request you just need to set the HTTP header Authorization with a value of the form

Bearer YOUR_TOKEN_GOES_HERE

The Flow

The sending system obtains a token from the Identity Provider (IDP) for its own identity, then presents it with each request. Stroom or Stroom-Proxy verifies that token against the IDP’s published signing keys, exactly as it would verify any other bearer token.

images/sending-data/token-authentication.puml.svg

Obtaining a token and sending data with it

Tokens are short lived, typically around an hour, so a sender must obtain a fresh one when the old one expires rather than caching one indefinitely.