Aiven-Open / Aiven-Open/http-connector-for-apache-kafka

Unable to use OAuth2 authentication

Open
#173 2 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
119
Forks
63
PR merge metrics
No merged PRs in 30d

Description

Hi,

Before using your http-connector we need first to be able to authenticate to an API provider with oauth2. Unfortunately the API Publishers didn't implement a standard way to retrieve an access token. Instead they developed their own api with the following form (see https://api.didomi.io/docs/#/sessions/post_sessions):

```json
{
"type": "api-key",
"key": "my_client_id",
"secret": "my_secret"
}
```

Our proposal is to bring additional configuration to configure the form field. For example we would have the following configuration to implement the oauth2 form described above:

```json
{
"name": "http-sink-test",
"config": {
"connector.class": "io.aiven.kafka.connect.http.HttpSinkConnector",
"topics.regex": "domain_a.*",
"http.url": "http://httpmockserver:1080",
"http.authorization.type": "oauth2",
"http.headers.content.type": "application/json",
"oauth2.access.token.url": "http://httpmockserver:1080/oauth2",
"oauth2.client.authorization.mode": "URL",
"oauth2.grant_type.key": "type",
"oauth2.grant_type": " api-key",
"oauth2.client.id": "my_client_id",
"oauth2.client.id.key": "key",
"oauth2.client.secret": "my_secret",
"oauth2.client.secret.key": "secret",
"key.converter": "org.apache.kafka.connect.storage.StringConverter",
"value.converter": "org.apache.kafka.connect.json.JsonConverter"
}
}
```

We already have made a fork to implement this issue on our side as we need to move forward on our production schedule. For that 2 PRs were pushed:
- https://github.com/aiven/http-connector-for-apache-kafka/pull/171: a refactor in order to properly test each configuration and ensure we are still able to use oauth2 with default values.
- https://github.com/aiven/http-connector-for-apache-kafka/pull/172: additional oauth2 configuration

Thank you

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.