Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to pass the authentication extension username to processor #27902

Closed
pkalvagit opened this issue Oct 23, 2023 · 3 comments
Closed

how to pass the authentication extension username to processor #27902

pkalvagit opened this issue Oct 23, 2023 · 3 comments
Labels
extension/basicauth needs triage New item requiring triage question Further information is requested Stale waiting for author

Comments

@pkalvagit
Copy link

pkalvagit commented Oct 23, 2023

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 code md, _ := metadata.FromIncomingContext(ctx) in authentication extension, i am getting headers with authorization 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

@pkalvagit pkalvagit added the needs triage New item requiring triage label Oct 23, 2023
@crobert-1 crobert-1 added question Further information is requested extension/basicauth labels Oct 23, 2023
@github-actions
Copy link
Contributor

Pinging code owners for extension/basicauth: @jpkrohling @svrakitin @frzifus. See Adding Labels via Comments if you do not have permissions to add labels yourself.

@jpkrohling
Copy link
Member

Can you share the config for your collector? Are you setting the IncludeMetadata flag in your receiver?

@crobert-1
Copy link
Member

Hello @pkalvagit, without the full configuration you're using we can't provide any more guidance than what @jpkrohling has shared. I'm going to close for now, but please feel free to reopen and share more information!

@crobert-1 crobert-1 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension/basicauth needs triage New item requiring triage question Further information is requested Stale waiting for author
Projects
None yet
Development

No branches or pull requests

3 participants