简体   繁体   English

我如何获得CGIHTTPServer要求用户/密码

[英]How do I get CGIHTTPServer to ask for user/pass

I just want to start a CGI HTTP Server in Python, that asks for user/pass. 我只想在Python中启动CGI HTTP Server,要求输入用户名/密码。 How can I do this? 我怎样才能做到这一点?

The HTTP Basic authentication (with a browser popup box that asks for name/password) will be fine (and probably preferred). HTTP基本身份验证(带有要求输入名称/密码的浏览器弹出框)会很好(并且可能是首选)。

Returning a status code of 401 and a WWW-Authenticate header will tell the browser to prompt the user for credentials. 返回状态码401和WWW-Authenticate标头将告诉浏览器提示用户输入凭据。 See RFC 2617 for details. 有关详细信息,请参见RFC 2617

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

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