External Authentication with username in header

59 views
Skip to first unread message

Mark Glass

unread,
Jul 15, 2022, 5:30:42 PM7/15/22
to Django users
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 

Abdul Qoyyuum

unread,
Jul 17, 2022, 9:20:51 PM7/17/22
to django...@googlegroups.com
That sounds like a Single Sign On or a Central Authentication Service. This stackoverflow shows some suggestions https://stackoverflow.com/q/4662348/1431104

Or if your "External Authentication" is a known provider service, you could take a look at django-allauth.

--
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...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/4f1b2a47-6d3d-45e2-9c93-8bbca78d3e34n%40googlegroups.com.


--
Abdul Qoyyuum Bin Haji Abdul Kadir

Ryan Nowakowski

unread,
Jul 18, 2022, 9:10:03 AM7/18/22
to django...@googlegroups.com

tcouch

unread,
Jul 19, 2022, 11:32:56 AM7/19/22
to Django users
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

Anh Nguyen

unread,
Jul 19, 2022, 11:56:25 AM7/19/22
to django...@googlegroups.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...@googlegroups.com.

Hella thor

unread,
Jul 19, 2022, 8:35:56 PM7/19/22
to django...@googlegroups.com
你可以尝试下JWT,在django中使用的话是pyjwt

Anh Nguyen <bboy...@gmail.com> 于2022年7月19日周二 23:56写道:
Reply all
Reply to author
Forward
0 new messages