基于证书和IP的认证
有没有一种方法可以让 java web 应用程序通过 http 请求获取有关计算机上安装的安全证书的信息,并在计算机上安装了特定证书时有选择地授予访问权限。
基本上要求是,Web 应用程序应仅接受来自公司笔记本电脑的请求,否则必须使用适当的错误文本拒绝访问。
(这些可能是在其计算机上安装了某些证书的 win 笔记本电脑,或者它们可能来自一组特定的静态 ip。)
Is there a way for a java web app to get information on the security certificates installed on one's machine via a http request and selectively grant access if a particular certifiicate is installed on the machine.
Basically the requirement is, the web application should entertain request only from a company laptop else must deny access with appropriate error text.
(These could be win laptops with certain certifcates installed on their machine or they can be from a certain set of static ips.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的,可以使用 HTTPS 客户端证书实现这一点。确切的设置和配置取决于您的应用程序服务器和特定要求,但常见的情况是您创建公司内部 CA(证书颁发机构)来颁发可能仅限于特定客户端 IP 地址的客户端证书,并配置应用程序服务器的HTTPS 连接器需要客户端证书并信任您自己的 CA 颁发的证书。
完成正确的配置后,客户端证书将通过 servlet 请求属性提供给 Web 应用程序:
Yes, this is possible using HTTPS client certificates. The exact setup and configuration depends on your application server and specific requirements, but a common scenario woul be that you create a company internal CA (certification authority) to issue the client certificates which may be restricted to specific client IP addresses and configure your application server's HTTPS connector to require a client certificate and to trust certificates issued by your own CA.
After the proper configuration has been done, the client certificate(s) is/are made available to the web application through a servlet request attribute:
正如 jambjo 所说 - 正如他所描述的那样,您绝对可以通过 HTTPS 和客户端身份验证来获取客户端证书。我建议通过静态 IP,证书更难被欺骗,并且如果您将来需要以不同的方式重新配置网络,则可以提供更大的灵活性。
其他一些想法:
As jambjo said - you can absolutely get client certificates through HTTPS with client authentication as he described. I'd recommend that over static IPs, a certificate is harder to spoof and allows more flexibilty if you need to reconfigure the network differently in the future.
A couple other thoughts: