Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrations - bearer token - OAuth client credentials #127

Open
PhilipSkinner opened this issue May 26, 2022 · 0 comments
Open

Integrations - bearer token - OAuth client credentials #127

PhilipSkinner opened this issue May 26, 2022 · 0 comments

Comments

@PhilipSkinner
Copy link
Owner

Add support for client credentials bearer token authentication on outgoing HTTP requests.

The configuration for this authentication mechanism should be:

{
  "request": {
    "uri": "https://jsonplaceholder.typicode.com/posts/$.body.id",
    "method": "get",
    "authentication" : {
      "mechanism" : "client_credentials",
      "type" : "bearer",
      "config" : {
        "client" : "my-client",
        "scopes" : [
          "scope_1",
          "scope_2"
        ]
      }
    }
  }
}

The client value references an oauth provider. The scopes are an optional set of scopes which override the default scopes setup within the oauth provider.

Create a refreshing token store that can always return a valid token into the requestService. As we do not know the structure of the token, and we may not be able to inspect it to determine its expiration, the token store should assume that it is not possible to glean this information from the token. Instead it should provide a mechanism for handling 401 responses from the requestService.sendRequest method, which will refresh the token. This must not cause an infinite loop and should only be retried once.

When this authentication mechanism is present the requestService within the integration application should add an {{Authorization}} header to the outgoing request with the value of Bearer followed by the token received from the refreshing token store:

Authorization: Bearer <token>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant