apache / apache/pinot

HTTP 1.1 authentication challenge

Open
#11,483 2 comments 0 reactions 0 assignees View on GitHub
bug security
Dominant language
Java
Stars
6.1k
Forks
1.5k
Avg merge
2d 55m
Merged PRs (30d)
182

Description

Pinot broker doesn't follow the HTTP 1.1 authentication challenge standard.
The workflow is describe here : https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication
and is also used by the java standard HttpClient.

It prevents from correctly authenticate to the broker using code like this :
```kotlin
val request = HttpRequest.newBuilder(URI.create("https://secured_broker:8099/query/sql"))
.header("Content-Type", "application/json")
.header("Accept", "application/json")
.build()

val client = HttpClient.newBuilder()
.authenticator(object: Authenticator(){
override fun getPasswordAuthentication() = PasswordAuthentication("login", "password".toCharArray())
})
.build()

val result = client.send(request, HttpResponse.BodyHandlers.ofInputStream())
print(result)
```

Java client first try the request without Authorization header. And then resend the request with the Authorization in case of 401.
Currently, broker seems to only return 403 Http code which is a dead end from the java client perspective

Contributor guide

Open the contributing guide

Research direction

Start at the Pinot broker's HTTP authentication handling and compare its 401/403 behavior with the HTTP Authentication workflow and Java HttpClient sequence described in the issue. Done when an unauthenticated request receives the challenge response needed for the client to resend credentials, and the Kotlin example can authenticate successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
api, authentication, backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.