how to pass the authentication extension username to processor #27902
Labels
extension/basicauth
needs triage
New item requiring triage
question
Further information is requested
Stale
waiting for author
Component(s)
No response
Describe the issue you're reporting
hi There,
I have implemented basic auth extension. (which is similar to https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/extension/basicauthextension). Implemented our own custom logic to authenticate.
In Authenticate method, i am getting credentials and successfully able to validate and return client.auth data as well(same as : https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/basicauthextension/extension.go#L111). In Processors, when i try to access metadata using
md, _ := metadata.FromIncomingContext(ctx)
i am getting empty list in processors. if call same codemd, _ := metadata.FromIncomingContext(ctx)
in authentication extension, i am getting headers withauthorization
key.Now, question is how to can pass cleint.username(https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/basicauthextension/config.go#L26) from config.yaml ( where i define pipeline with extensions, receivers, processors, exporters) which is returned from authentication extension https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/extension/basicauthextension/extension.go#L111.
Any help is highly appreciated!
In opentelemetry collector i have seen comments to access client info form authentication to processor authprinter processors but there is no clear example https://github.com/open-telemetry/opentelemetry-collector/blob/extension/auth/v0.87.0/client/client.go#L68 .. i tried to refer as mentioned in documentiaon https://github.com/open-telemetry/opentelemetry-collector/blob/extension/auth/v0.87.0/client/client.go#L68.. not sure how to refer that
The text was updated successfully, but these errors were encountered: