What is the reason that you need to change req.user in the first place?

There is a back door way of doing what you want but it entails needing
to writing a C extension or use some Python SWIG bindings which exist.
I am not sure though whether I will continue to keep the backdoor
though as no one has expressed any real interest in developing the
idea.

FWIW, the SWIG bindings are at:

  https://bitbucket.org/grahamdumpleton/apswigpy/wiki/Home

No idea if they still build.

You would set:

  WSGIPassApacheRequest On

in Apache configuration.

This results in environ passed having 'apache.request_rec' attribute.

>From memory you then do something like:

  import apache.httpd
  r = apache.httpd.request_rec(environ['apache.request_rec'])
  r.user = 'xxx'

Graham

On 26 May 2011 22:51, fsang <[email protected]> wrote:
> Hi,
>
> I am using a PHP application and a Python auth script through the
> Apache webserver. Right now I am using mod_python which I want to
> replace with mod_wsgi (for various reasons). One issue I have with
> mod_wsgi is that I don't know how to modify the username (REMOTE_USER)
> in a WSGIAuthUserScript.
>
> In mod_python I could simply change *request.user* to any value and
> PHP would use this value in $_SERVER['REMOTE_USER']. How would I  do
> this in the check_password() function of a wsgi script?
>
>
> Regards,
> Frederik
>
> --
> You received this message because you are subscribed to the Google Groups 
> "modwsgi" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/modwsgi?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"modwsgi" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/modwsgi?hl=en.

Reply via email to