The last login is stored in the session using the social_auth_last_login_backenddefault key , otherwise yes, checking the instances UserSocialAuthis the preferred way by doing user.social_auth.filter().
Both methods can be combined by doing:
user.social_auth.filter(provider=request.session['social_auth_last_login_backend'])
source
share