Skip to content

Unable to use OAuth2 authentication #173

@aprodhomme-dkt

Description

@aprodhomme-dkt

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):

{
  "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:

{
  "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:

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions