-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
"bearertokenauth" extension Always return "401 Unauthorized" via HTTP connection #24656
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
@pavankrish123 @frzifus, are you able to take a look? |
Don't go into the extension via HTTPIt doesn't trigger the token comparing while the Token isn't matching. make run.localhost.http
HOSTNAME=localhost.with-token.http SERVER_INFO=http://127.0.0.1:55681 go run .
2023/07/31 11:26:13 Waiting for connection...
2023/07/31 11:26:13 Doing really hard work (1 / 10)
2023/07/31 11:26:14 Doing really hard work (2 / 10)
2023/07/31 11:26:15 Doing really hard work (3 / 10)
2023/07/31 11:26:16 Doing really hard work (4 / 10)
2023/07/31 11:26:17 Doing really hard work (5 / 10)
2023/07/31 11:26:18 Doing really hard work (6 / 10)
2023/07/31 11:26:18 traces export: failed to send to http://127.0.0.1:55681/v1/traces: 401 Unauthorized
2023/07/31 11:26:19 Doing really hard work (7 / 10)
2023/07/31 11:26:20 Doing really hard work (8 / 10)
2023/07/31 11:26:21 Doing really hard work (9 / 10)
2023/07/31 11:26:22 Doing really hard work (10 / 10)
2023/07/31 11:26:23 traces export: failed to send to http://127.0.0.1:55681/v1/traces: 401 Unauthorized
2023/07/31 11:26:23 Done!
2023/07/31 11:26:23 traces export: failed to send to http://127.0.0.1:55681/v1/traces: 401 Unauthorized everything goes as expect via gRPC. make run.localhost.grpc
HOSTNAME=localhost.with-token.grpc SERVER_INFO=grpc://127.0.0.1:55680 go run .
2023/07/31 11:25:58 Waiting for connection...
2023/07/31 11:25:58 Doing really hard work (1 / 10)
2023/07/31 11:25:59 Doing really hard work (2 / 10)
2023/07/31 11:26:00 Doing really hard work (3 / 10)
2023/07/31 11:26:01 Doing really hard work (4 / 10)
2023/07/31 11:26:02 Doing really hard work (5 / 10)
2023/07/31 11:26:03 Doing really hard work (6 / 10)
2023/07/31 11:26:03 traces export: rpc error: code = Unknown desc = scheme or token does not match: Bearer vyAQ21d5NCfUIXe_____
2023/07/31 11:26:04 Doing really hard work (7 / 10)
2023/07/31 11:26:05 Doing really hard work (8 / 10)
2023/07/31 11:26:06 Doing really hard work (9 / 10)
2023/07/31 11:26:07 Doing really hard work (10 / 10)
2023/07/31 11:26:08 Done!
2023/07/31 11:26:08 traces export: rpc error: code = Unknown desc = scheme or token does not match: Bearer vyAQ21d5NCfUIXe_____
2023/07/31 11:26:08 traces export: rpc error: code = Unknown desc = scheme or token does not match: Bearer vyAQ21d5NCfUIXe_____ |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
Sorry for taking so long to take a look at this, I've added this to my queue. |
Same problem here with HTTP receiver as @tangx |
…"401 Unauthorized" via HTTP connection #24656 (#29992) Fix for extension Always return "401 Unauthorized" via HTTP connection #24656 **Description:** We are always trying to get the `authorization` with the lower case from headers, But The headers from Http is received as `Authorization` capitalcase even-though we sent in lower case. **Link to tracking Issue:** <[24656](#24656)> **Testing:** Tested in the local <img width="1060" alt="Screenshot 2023-12-17 at 5 28 26 PM" src="https://github.com/open-telemetry/opentelemetry-collector-contrib/assets/94837505/a7401d32-9ce2-4ac5-b4a4-94b43d1efcc8"> <img width="919" alt="Screenshot 2023-12-17 at 5 32 11 PM" src="https://github.com/open-telemetry/opentelemetry-collector-contrib/assets/94837505/b7778fc1-1dee-487a-8458-669b8bf5ec2e"> <img width="890" alt="Screenshot 2023-12-17 at 5 34 12 PM" src="https://github.com/open-telemetry/opentelemetry-collector-contrib/assets/94837505/369577d3-7ddf-45e9-be25-81e699e56e2a"> --------- Co-authored-by: Curtis Robert <crobert@splunk.com>
…"401 Unauthorized" via HTTP connection open-telemetry#24656 (open-telemetry#29992) Fix for extension Always return "401 Unauthorized" via HTTP connection open-telemetry#24656 **Description:** We are always trying to get the `authorization` with the lower case from headers, But The headers from Http is received as `Authorization` capitalcase even-though we sent in lower case. **Link to tracking Issue:** <[24656](open-telemetry#24656)> **Testing:** Tested in the local <img width="1060" alt="Screenshot 2023-12-17 at 5 28 26 PM" src="https://github.com/open-telemetry/opentelemetry-collector-contrib/assets/94837505/a7401d32-9ce2-4ac5-b4a4-94b43d1efcc8"> <img width="919" alt="Screenshot 2023-12-17 at 5 32 11 PM" src="https://github.com/open-telemetry/opentelemetry-collector-contrib/assets/94837505/b7778fc1-1dee-487a-8458-669b8bf5ec2e"> <img width="890" alt="Screenshot 2023-12-17 at 5 34 12 PM" src="https://github.com/open-telemetry/opentelemetry-collector-contrib/assets/94837505/369577d3-7ddf-45e9-be25-81e699e56e2a"> --------- Co-authored-by: Curtis Robert <crobert@splunk.com>
Component(s)
extension/bearertokenauth
What happened?
Description
When set bearertokenauth
it always returns "401 Unauthorized" via HTTP(S) Connection.
but it works via gRPC Connection
Steps to Reproduce
OTel-Collector-Contrib Config
My Go file
Expected Result
Success
Actual Result
401 Unauthorized
Collector version
v0.81.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
OpenTelemetry Collector configuration
Log output
Additional context
No response
The text was updated successfully, but these errors were encountered: