Configuring OAuth 2.0 Authentication
The Open Workflow DSL can describe an OAuth 2.0 client credentials grant. Lemline registers such a definition, but its HTTP executor supports only basic and bearer authentication: an instance faults before sending any request. See Supported Features. Until OAuth 2.0 is supported, obtain the token outside the workflow and send it with bearer authentication.
Client credentials grant
Place the oauth2 authentication policy on the endpoint, with the authority, grant and client configuration. The token endpoint can be specified under endpoints.
The client secret stays outside the definition: the policy reads it from the declared clientSecret secret.
See what Lemline does with it
Complete the SQLite setup and start the tutorial shop from the root of the Lemline source checkout. The shop has no token endpoint; the request never gets that far. With the JAR, substitute java -jar lemline.jar for bin/lemline.
Stop the setup worker with Ctrl+C, export the secret, and start the worker again:
From a second terminal in the setup directory, save the definition as http-with-authentication.yaml and run it:
The definition registers. The instance faults with a runtime error titled Unsupported OAuth2 authentication, and the shop receives no request. Stop the shop when you are done: