简体   繁体   English

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

[英]Authentication with mod_python without login credentials popup

I am using Centos server with apache server. 我正在将Centos服务器与apache服务器一起使用。 I have added python script that reads my website's login cookie and based on that it return apache.OK or apache.HTTP_UNAUTHORIZED. 我添加了python脚本,该脚本读取我的网站的登录cookie,并以此为基础返回apache.OK或apache.HTTP_UNAUTHORIZED。 However even if cookies is present, it will pop up that login form. 但是,即使存在cookie,它也会弹出该登录表单。

Any help on how to remove that pop up is appreciated. 感谢您提供有关如何删除该弹出窗口的任何帮助。

I tried removing AuthType Basic, but than i get following error 我尝试删除AuthType Basic,但随后出现以下错误

The server encountered an internal error or misconfiguration and was unable to complete your request. 服务器遇到内部错误或配置错误,无法完成您的请求。

  <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

just found out if you don't want login pop up , you will have to set up req.user to something 刚发现如果您不想弹出登录名,则必须将req.user设置为

It was throwing error before that req.user is null. 在req.user为null之前抛出错误。 I did this req.user = "nobody" 我做了这个req.user = "nobody"

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

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