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

Support Authorization with Proxy server (in client) #1213

Closed
ktoso opened this Issue Jun 20, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@ktoso
Member

ktoso commented Jun 20, 2017

In #1200 (comment) we implemented HTTP(S) proxy support, however we did not yet implement authorization support, this ticket is to address that.

@ktoso

This comment has been minimized.

Show comment
Hide comment
@ktoso

ktoso Jun 20, 2017

Member

FYI @note

Member

ktoso commented Jun 20, 2017

FYI @note

@Scalahansolo

This comment has been minimized.

Show comment
Hide comment
@Scalahansolo

Scalahansolo Jun 28, 2017

Contributor

After giving this a couple shots I am getting lost trying to implement this. Until I have time to do some more digging, I don't quite have the knowledge necessary to figure out how to pass the proxy auth header after the proxy responds with a 407. I also don't have the greatest understanding of how BiDi flows work, which I am now trying to level up on.

Contributor

Scalahansolo commented Jun 28, 2017

After giving this a couple shots I am getting lost trying to implement this. Until I have time to do some more digging, I don't quite have the knowledge necessary to figure out how to pass the proxy auth header after the proxy responds with a 407. I also don't have the greatest understanding of how BiDi flows work, which I am now trying to level up on.

@jrudolph

This comment has been minimized.

Show comment
Hide comment
@jrudolph

jrudolph Jun 29, 2017

Member

Actually, I would send the authorization data proactively before the proxy can even respond with 407. After it has responded it might even be impossible to use CONNECT on the same connection again. I'd say that retrying CONNECT on another connection is currently out of scope.

Basically, how the thing should work is by adding optional credentials (could be of type HttpCredentials to support all kinds of credentials even if basic authorization is probably the most common one?) to the httpsProxy constructor and passing them on to the stage. In the stage, the initial CONNECT request is currently built using string manipulation. For now, it would be ok to add the authentication header there manually by string as well. You should probably create an instance of model.headers.Proxy-Authorization with the credentials and use its render method with a StringRendering to render the header.

Does that explanation make sense. Hopefully that would be enough for a first cut.

Member

jrudolph commented Jun 29, 2017

Actually, I would send the authorization data proactively before the proxy can even respond with 407. After it has responded it might even be impossible to use CONNECT on the same connection again. I'd say that retrying CONNECT on another connection is currently out of scope.

Basically, how the thing should work is by adding optional credentials (could be of type HttpCredentials to support all kinds of credentials even if basic authorization is probably the most common one?) to the httpsProxy constructor and passing them on to the stage. In the stage, the initial CONNECT request is currently built using string manipulation. For now, it would be ok to add the authentication header there manually by string as well. You should probably create an instance of model.headers.Proxy-Authorization with the credentials and use its render method with a StringRendering to render the header.

Does that explanation make sense. Hopefully that would be enough for a first cut.

jrudolph added a commit to jrudolph/akka-http that referenced this issue Jul 18, 2017

jrudolph added a commit to jrudolph/akka-http that referenced this issue Jul 18, 2017

Scalahansolo pushed a commit to Scalahansolo/akka-http that referenced this issue Jul 27, 2017

ktoso added a commit that referenced this issue Jul 31, 2017

@ktoso

This comment has been minimized.

Show comment
Hide comment
@ktoso

ktoso Jul 31, 2017

Member

Solved by @Scalahansolo, thanks!

Member

ktoso commented Jul 31, 2017

Solved by @Scalahansolo, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment