pcibraro / hawknet

Hawk protocol implementation for .NET
MIT License
114 stars 35 forks source link

Owin hosting non standard port and bad mac #21

Closed suddenelfilio closed 9 years ago

suddenelfilio commented 10 years ago

I know you already noticed this yourself. When you use owin hosting the authentication fails because the port is not set correctly you can see this when the normalized string is printed in the trace.

Is there any update or workaround? maybe force a configurable value?

pcibraro commented 10 years ago

Sorry for the delay. I was on vacations. Let me check if this is still a bug with the latest owin nuget packages or otherwise, I will try to report it as a bug to Microsoft.

BrannonKing commented 9 years ago

It appears this is till an issue. Hawknet works with Owin running on port 80 but not 19000. You say this is an Owin bug? What is the exact bug?

BrannonKing commented 9 years ago

I filed an issue: https://katanaproject.codeplex.com/workitem/400

BrannonKing commented 9 years ago

It ends up that the issue is with the HawkNet library. I found it and put in a pull request: https://github.com/pcibraro/hawknet/pull/28 . The HawkClientMessageHandler.SendAsync override has this line: request.Headers.Host = request.RequestUri.Host;. That line is wrong; it needs the port. The OwinRequest.Host property includes the port but the Uri.Host does not; I can see where it would get confusing. The SignRequest method actually gets it right when the header is absent, so I just removed that header setter to fix the issue. Setting the Host header from the client doesn't seem quite right anyhow.

pcibraro commented 9 years ago

Awesome. Thanks for working on this. I will apply your pull request

pcibraro commented 9 years ago

I just pushed the updated version of the nuget package. Thanks

BrannonKing commented 9 years ago

I see that the HawkNet.Owin package was renewed today. However, wasn't this fix in the HawkNet.WebApi package?

pcibraro commented 9 years ago

Yes. Let me release that package as well

BrannonKing commented 9 years ago

Any ETA on releasing the WebApi package? Thanks for your time on this.

pcibraro commented 9 years ago

I just pushed it. Sorry it took so long. Thanks

BrannonKing commented 9 years ago

It's working well. Thank you.