繁体   English   中英

使用mod_python进行身份验证,不弹出登录凭据

[英]Authentication with mod_python without login credentials popup

我正在将Centos服务器与apache服务器一起使用。 我添加了python脚本,该脚本读取我的网站的登录cookie,并以此为基础返回apache.OK或apache.HTTP_UNAUTHORIZED。 但是,即使存在cookie,它也会弹出该登录表单。

感谢您提供有关如何删除该弹出窗口的任何帮助。

我尝试删除AuthType Basic,但随后出现以下错误

服务器遇到内部错误或配置错误,无法完成您的请求。

  <Directory "/var/www/html/reports" >
  AddHandler mod_python .py
  PythonHandler /tmp/access.py
  PythonAuthenHandler /tmp/access.py
  PythonDebug On
  SSLRequireSSL
  AllowOverride AuthConfig
  #AuthType Basic
  AuthName "Restricted Area"
  AuthBasicAuthoritative Off
  Options -Indexes
  require valid-user

刚发现如果您不想弹出登录名,则必须将req.user设置为

在req.user为null之前抛出错误。 我做了这个req.user = "nobody"

暂无
暂无

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

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