elastic / elastic/apm-agent-android

Set Authorization header dynamically

Open
#347 4 comments 0 reactions 1 assignee Claimed by @LikeTheSalad View on GitHub
agent-android agent-mobile community triage v1.0.0
Dominant language
Kotlin
Stars
43
Forks
22
Avg merge
2d 1h
Merged PRs (30d)
26

Description

### Context
`Connectivity` is used to provide custom authorization header value. It's used once the whole apm agent is being initialized.

### Issue
The whole APM service could live behind a custom auth proxy server, and authorization token could change dynamically. Currently there is no way to change the auth token value without resetting and re-initializing the whole agent.

### Possible solution

Let `Connectivity` return "provider" for `authConfiguration()` and use `setHeaders(Supplier> headerSupplier)` instead of `addHeader(...)` for exporters.

Even better would be to clone `setHeader` behaviour for `Connectivity` to return a set of headers for every request instead of single auth header value -> because e.g. proxy server could demand some custom headers to identify user – this would be the most flexible yet easy implementable for current key/secret predefined variants.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.