How to reset is_actibe field of auth_user

17 views
Skip to first unread message

Kamakshi Aggarwal

unread,
Aug 24, 2020, 8:16:43 AM8/24/20
to django...@googlegroups.com
Hi,

We are using django application in our company. We are using RemoteUserAuthentication for that(single sign on). Only employees can sign in.
 Once employee signs in,is_active filed is set to True by default in auth_user table.
 
Now if user leaves the company how should I set "is_active" field to False.

Thanks
Kamakshi

Amresh Giri

unread,
Aug 24, 2020, 10:35:55 AM8/24/20
to django...@googlegroups.com
I think this setting can be handled from your IDP side in the application. 

--
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/CAAK5yVtWjyate%2BNuzv58yq-%2Bo9Kd5wju%3DKVP7iBUOSCGc7YSsw%40mail.gmail.com.

Kamakshi Aggarwal

unread,
Aug 25, 2020, 1:18:54 AM8/25/20
to django...@googlegroups.com
Can you explain it more to me? Its not clear.

Amresh Giri

unread,
Aug 25, 2020, 1:42:26 AM8/25/20
to django...@googlegroups.com
This setting can be configured from the Identity Provider account like Okta, onelogin, etc when you create an app on it. 

Mike Dewhirst

unread,
Aug 25, 2020, 2:37:33 AM8/25/20
to django...@googlegroups.com
On Mon, Aug 24, 2020, 5:46 PM Kamakshi Aggarwal
<kamaks...@gmail.com> wrote:
>  
> Now if user leaves the company how should I set "is_active" field to
> False.
>

There are two ways to do it. One is to write a view which lets someone
in HR turn it off. The other is to use Django Admin with the correct
privileges and do the same.

If is_active == False, django.auth will disable login for that user. I
don't know about your SSO backend. You need to ensure that it respects
is_active in the same way as Django.

Cheers

Mike

--
Signed email is an absolute defence against phishing. This email has
been signed with my private key. If you import my public key you can
automatically decrypt my signature and be sure it came from me. Just
ask and I'll send it to you. Your email software can handle signing.


signature.asc
Reply all
Reply to author
Forward
0 new messages