WSGI作为AuthFormProvider [英] WSGI as AuthFormProvider

查看:74
本文介绍了WSGI作为AuthFormProvider的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在Apache2.4中将"wsgi"用作AuthFormProvider?

Is it possible to use 'wsgi' as an AuthFormProvider in Apache2.4?

我第一次编辑了此处找到的示例. 现在,配置看起来像这样,但是不起作用:

As a first attempt I edited the examples found here. The configuration now looks like this but does not work:

<Location "/test">
    AuthType Form
    AuthFormProvider wsgi
    AuthName "test"
    AuthFormLoginRequiredLocation /login.html
    WSGIAuthUserScript /path/to/django/wsgi.py
    WSGIAuthGroupScript /path/to/django/wsgi.py
    Require Group test
    Require valid-user
    Session On
    SessionCookieName xyz path/
    SessionCrypotPassphrase 123456789
</Location>

推荐答案

解决方案是我必须更新到mod_wsgi 4.3.0并更改配置,如Graham Dumpleton在他的回答中提到的那样(或

The solution is that I had to update to mod_wsgi 4.3.0 and change the configuration as Graham Dumpleton mentioned in his answer (or here).

除了更新之外,我还删除了AuthFormLoginRequiredLocation指令,并添加了ErrorDocument指令.

In addition to the update I removed the directive AuthFormLoginRequiredLocation and added an ErrorDocument directive instead.

工作配置现在看起来像这样:

The working configuration now looks like this:

<Location "/test">
    AuthType Form
    AuthFormProvider wsgi
    AuthName "test"
    ErrorDocument 401 /login.html
    WSGIAuthUserScript /path/to/django/wsgi.py
    WSGIAuthGroupScript /path/to/django/wsgi.py
    <RequireAll>
        Require wsgi-group test
        Require valid-user
    </RequireAll>
    Session On
    SessionCookieName xyz path/
    SessionCrypotPassphrase 123456789
</Location>

这篇关于WSGI作为AuthFormProvider的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆