如何获取 SPNEGO / Kerberos 会话密钥 - 并实现 HTTP 身份验证:在我自己的客户端上协商
我最近接触到了一种我不知道的新身份验证方法。 经过阅读和研究理解后,我明白它与 SPNEGO 有关,或者可能只是 spnego。
我在大型网络上运行Windows XP,当我的浏览器自动打开它时 连接到网络中的 Web 服务,需要身份验证:
HTTP/1.1 401 Unauthorized WWW-Authenticate: Negotiate
然后我的浏览器会自动发送(当然还有更多标头):
Authorization: Negotiate (加密字符串)。
我得出的结论是,这次握手使用了 SPNEGO 协议。
我需要做的是创建我自己的客户端(实际上,它是一个使用需要身份验证的网络服务的机器人)。我需要在没有任何用户交互的情况下获取该加密字符串(就像我的浏览器获取它一样,可能是通过使用某些 SPNEGO 协议)(同样,就像我的浏览器一样)。
问题是,我没有足够的时间来研究 spnego 协议以及如何实施该协议。
我正在使用 c/c++,但如果我没有选择 c# 也可以。 是否有任何函数/类/代码,甚至可能是好的教程来帮助我尽快实现它?
I was recently exposed to a new authentication method i had no idea of.
After reading a bit and researching to understand it,I understood it has something to do with SPNEGO, or maybe it is just spnego.
Im running windows xp on a large network, when my browser opens it automatically
connects to a web-service in the network, which requires authentication:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Negotiate
then my browser sends automatically (along with more headers ofcourse):
Authorization: Negotiate (encrypted string).
I concluded this Handshake uses the SPNEGO protocol.
What i need to do, is to create my own client (actually,its a bot that uses this webservice that requires that authentication). I Need to get that encrypted string (exactly like my browser gets it, probably by using some SPNEGO protocol) without any user interaction (again, as my browser).
the thing is, that i don't have enough time to study the spnego protocol and how to implement one.
I'm using c/c++, but if i have no option c# would be okay as well.
Are there any functions / classes / codes or maybe even good tutorials to help me implement it shortly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
curl
适用于 Kerberos/spnego。我不确定这个功能在 Windows 上的效果如何,您应该尝试看看。它在 Linux 上运行得很好。您可以查看源代码以了解它是如何完成的。curl
works with Kerberos/spnego. I'm not sure how well this functionality works on Windows, you should try and see. It works well enough on Linux. You can look at the source to see how it is done.