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

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

>
> https://docs.djangoproject.com/en/4.1/ref/contrib/auth/#django.contrib.auth.backends.RemoteUserBackend.configure_user
> Django 4.1 now supports ext auth. Never try but hope this helps
>
> On Tue, 19 Jul 2022 at 22:32 tcouch <t.co...@ucl.ac.uk> wrote:
>
>> I did something like this recently when I was trying to get a django app
>> to work with Authelia <https://www.authelia.com/>. 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:
>>
>>> Middleware is how Django does it.
>>>
>>>
>>> https://docs.djangoproject.com/en/4.0/ref/middleware/#module-django.contrib.auth.middleware
>>>
>>>
>>> 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+unsubscr...@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
>> <https://groups.google.com/d/msgid/django-users/79a344ad-433f-4390-80d0-5787d2812984n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
> --
> 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+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAKaoNbTvvUxFOc5TsqOez9LFyK9zcWCbiaYw1%2BhWxxRxAbUSZQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAKaoNbTvvUxFOc5TsqOez9LFyK9zcWCbiaYw1%2BhWxxRxAbUSZQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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+unsubscr...@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.

Reply via email to