Re: External Authentication with username in header

2022-07-19 Thread Hella thor
你可以尝试下JWT,在django中使用的话是pyjwt

Anh Nguyen  于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  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:
>>
>>> 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  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
>> 
>> .
>>
> --
> 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
> 
> .
>

-- 
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.


Re: External Authentication with username in header

2022-07-19 Thread Anh Nguyen
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  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:
>
>> 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  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
> 
> .
>

-- 
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.


Re: External Authentication with username in header

2022-07-19 Thread tcouch
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:

> 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  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.


Re: External Authentication with username in header

2022-07-18 Thread Ryan Nowakowski
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  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/4f1b2a47-6d3d-45e2-9c93-8bbca78d3e34n%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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/35914DE5-9803-4728-9829-6E201BD2DAE3%40fattuba.com.


Re: External Authentication with username in header

2022-07-17 Thread Abdul Qoyyuum
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.

On Sat, Jul 16, 2022 at 5:30 AM Mark Glass  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/4f1b2a47-6d3d-45e2-9c93-8bbca78d3e34n%40googlegroups.com
> 
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
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/CAA3DN%3DVj_A-ZVGVW8bWTM-f-5g4P8JXfEgN4kNqeot6d01-xAA%40mail.gmail.com.


External Authentication with username in header

2022-07-15 Thread Mark Glass
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/4f1b2a47-6d3d-45e2-9c93-8bbca78d3e34n%40googlegroups.com.