Unlink/disconnect/revoke on server-side

33 views
Skip to first unread message

Igor Melnyk

unread,
Jan 25, 2016, 8:03:09 PM1/25/16
to python-social-auth

Hi!

How can I unlink/disconnect/revoke social media account from my site on server-side (without used url socialauth_disconnect)?

After user.social_auth.all().delete() (on Django-project) user can't login with social media again :(

Thanks.

Matías Aguirre

unread,
Jan 26, 2016, 5:08:57 AM1/26/16
to Igor Melnyk, python-social-auth
Disconnect is basically that, an entry removal from the DB, plus some
extra functionality like check if it's OK to disconnect the social
account (avoiding such scenario when the user doesn't have a password
set), and issues revoke token calls to the providers (usually for
OAuth2 providers that implement such option).

I bet your problem with "user.social_auth.all().delete()" is that when
the user tries to use the social account again, there's no way to link
it to the original user account, so a new user is created instead,
right? If that's the case, you might need to enable user-association
by email (which isn't 100% secure), check here for more details
http://psa.matiasaguirre.net/docs/use_cases.html#associate-users-by-email.


Matías
--
Matías Aguirre
http://matiasaguirre.net

Igor Melnyk

unread,
Jan 29, 2016, 3:25:28 PM1/29/16
to python-social-auth
The problem was in session hash :)

But I have new proplem.
After success login with social I need check activity user. If user is not active then I have to generate url for restore account.
There is no any callbacks for this logic and I have problem to realisation this function.

Have you any advice?
Thanks.

Igor Melnyk

unread,
Jan 29, 2016, 3:43:57 PM1/29/16
to python-social-auth
I found way with using middleware, but "User.is_active" attribute is hardcoded in python-social-auth :(((

вівторок, 26 січня 2016 р. 03:03:09 UTC+2 користувач Igor Melnyk написав:
Reply all
Reply to author
Forward
0 new messages