简体   繁体   English

NancyFx如何访问底层的tcp连接

[英]NancyFx how to access to underlying tcp connection

I'm hacking around NancyFx framework and trying to implement NTLM authentication which is connection-oriented, as stated here : 我周围的黑客框架NancyFx并试图实施NTLM身份验证这是面向连接的,如说在这里

NTLM is connection-oriented, rather than request-oriented. NTLM是面向连接的,而不是面向请求的。 So a second request for "/index.html" would not carry any authentication information, and the server would request none. 因此,对“/index.html”的第二个请求不会携带任何身份验证信息,服务器也不会请求任何身份验证信息。 If the server detects that the connection to the client has been dropped, a request for "/index.html" would result in the server reinitiating the NTLM handshake. 如果服务器检测到与客户端的连接已被删除,则对“/index.html”的请求将导致服务器重新启动NTLM握手。

This means I need to track is this particular connection already authenticated or not. 这意味着我需要跟踪这个已经过身份验证的特定连接。 But for now I cannot see any mechanism how I could access to this information from NancyModule instance. 但是现在我看不到任何机制如何从NancyModule实例访问这些信息。

You can't - Nancy is hosting agnostic, as well as being able to run without any network at all, so it just isn't possible. 你不能 - 南希主持不可知,并且能够在没有任何网络的情况下运行,所以这是不可能的。 It also doesn't sit well with HTTP - although you have keep alive, in general you should probably shouldn't be considering it a persistent connection. 它也不适合HTTP - 虽然你保持活着,但一般来说你应该不应该把它视为持久连接。

Could you auth the first request then store a cookie so the authentication only happens once per session? 您是否可以验证第一个请求然后存储cookie,以便每次会话只进行一次身份验证?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM