Aiven-Open / Aiven-Open/http-connector-for-apache-kafka
OAuth2 Using Azure Active Directory
- Ngôn ngữ chính
- Java
- Star
- 119
- Fork
- 63
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I have a proof of concept set up and running on my local machine using the Aiven Http Connector. The idea is to configure the connector to consume data from a kafka topic and then publish the data into an Azure Event Hub. Everything works with one exception, the OAuth request sent to AAD. In order for AAD to respond with a proper access token an additional key/value needs to be added to the request (similar to how we pass along client_id, client_secret, and grant_type). This additional key/value is the resource that the token is being requested for.
I have cloned the Aiven repo, updated the code to support a new property named oauth.client.resource, and have been successful in having AAD return the proper access token such that calls to publish data into Azure Event Hubs works as expected. Without specifying the resource to AAD, an access token is returned however the call to publish the data into Azure Event Hubs is met with a 401 w/ SubCode of 40104: Invalid authorization token audience.
Here is the AAD documentation on the need to supply the resource on the request for the access token:
https://docs.microsoft.com/en-us/azure/event-hubs/authorize-access-azure-active-directory
As I understand it, the access token requestor must supply the resource to be accessed and in this case the resource is an Azure Event Hub, but it could be any resource.
My hope is that you consider adding the oauth2.client.resource configuration so that this connector can work securely with Azure resources.
Thank you.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.