Replies: 2 comments 5 replies
-
|
Great idea, but it is not part of the ASGI standard. You should go to asgiref to create a PR. When it becomes a standard, a2wsgi will quickly follow up on this part. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
In addition, perhaps a2wsgi should allow users to access Environ directly from Scope or access Scope from Environ. So all non-standard fields can be accessed, what do you think? |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The CGI RFC provides for a REMOTE_USER variable, which holds the username of the user who has been authenticated by the front-end Web server. For a WSGI application, this can be obtained as environ["REMOTE_USER"], since a WSGI application gets access to all CGI variables. It would be nice if an ASGI application could get access to the same thing.
For example, if I run the Flask application under the Apache server, with authorization through Active Directory, I can get the name of the authorized user in the remote_user variable.
Note: missing variables (such as REMOTE_USER when no authentication has occurred) should be left out of the environ dictionary (
PEP 3333).
To add the ability to access REMOTE_USER , you can do the following in asgi.py (in def build_scope(environ: Environ) -> Scope:):
Beta Was this translation helpful? Give feedback.
All reactions