confluent-kafka-dotnet icon indicating copy to clipboard operation
confluent-kafka-dotnet copied to clipboard

Add OAuth support to registry client

Open larserikfinholt opened this issue 5 months ago • 0 comments

The java client have a nice SASL_OAUTHBEARER_INHERIT, and also oauth support. Any chance this could be added?

The workaround I see today is to use the IAuthenticationHeaderValueProvider.. and implement this:

  AuthenticationHeaderValue IAuthenticationHeaderValueProvider.GetAuthenticationHeader()
  {
      return new AuthenticationHeaderValue("Bearer", _accessToken);
  }
_registryClient = new CachedSchemaRegistryClient(schemaConfig, myIAuthHeaderProvider);

Problem is that this gives my the follwing error:

[https://zzzzzzz.westeurope.azure.confluent.cloud/] HttpRequestException: Unauthorized

I noticed it calls the GetAuthenticationHeader where i provide a valid token but still no luck.

Should my workaround work, or are there more stuff that might not be supported? Any idea what I could try? (My admin client works fine)

larserikfinholt avatar Sep 23 '24 08:09 larserikfinholt