python-social-auth icon indicating copy to clipboard operation
python-social-auth copied to clipboard

Yahoo Oauth2 if no email returns guid on email place

Open halfstrik opened this issue 10 years ago • 1 comments

If Yahoo does not returns email, instead of it we get guid value. It's unusual, in most others backends we get empty string in this case. Is it for some reason, or it can be changed?

file social/backends/yahoo.py:

class YahooOAuth2(BaseOAuth2):
    ...
    def get_user_details(self, response):
        ...
        email = emails[0]['handle'] if emails else response.get('guid', '')

halfstrik avatar Feb 02 '16 20:02 halfstrik

There are a few options to override the default behavior:

  1. Add a custom pipeline after social_details that will alter the value in the details parameter
  2. Extend the Yahoo backend and override the get_user_details() method, then replace the line in AUTHENTICATION_BACKENDS to point to your version of the backend.

omab avatar Dec 26 '16 15:12 omab