Tuesday, July 19, 2022

Re: External Authentication with username in header

你可以尝试下JWT,在django中使用的话是pyjwt

Anh Nguyen <bboyadao@gmail.com> 于2022年7月19日周二 23:56写道:

On Tue, 19 Jul 2022 at 22:32 tcouch <t.couch@ucl.ac.uk> wrote:
I did something like this recently when I was trying to get a django app to work with Authelia. I found this example using the RemoteUserMiddleware useful: https://github.com/authelia/authelia/commit/8c9ba407f698eacc145e5fbe4e57fc27e7411261

On Monday, July 18, 2022 at 2:10:03 PM UTC+1 Ryan Nowakowski wrote:


On July 15, 2022 4:19:10 PM CDT, Mark Glass <mark....@gmail.com> wrote:
I would like to change the link that opens a Django app. Currently the app is launched with GET http://localhost:8000. I would like to include a username and password in the header. The header would be intercepted somehow (Middleware?) and the user marked as authenticated. The app will then launch for the user with a default role.

This will replace a login page and Django internal authentication. 

Can I implement this using middleware? If so, how?

Thank you 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/79a344ad-433f-4390-80d0-5787d2812984n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAKaoNbTvvUxFOc5TsqOez9LFyK9zcWCbiaYw1%2BhWxxRxAbUSZQ%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAE1PWzdCw%3D1dPBy3u1eovbHYwKXBmG4Krso3%2Buk%3DRhcvPVdnQ%40mail.gmail.com.

No comments:

Post a Comment