Authentication with mod_python without login credentials popup

I am using Centos server with apache server. I have added python script that reads my website's login cookie and based on that it return apache.OK or apache.HTTP_UNAUTHORIZED. However even if cookies is present, it will pop up that login form.

Any help on how to remove that pop up is appreciated.

I tried removing AuthType Basic, but than i get following error

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

1 answer

  • answered 2018-02-13 06:36 Isha Nagpal

    just found out if you don't want login pop up , you will have to set up req.user to something

    It was throwing error before that req.user is null. I did this req.user = "nobody"