For GitHub auth, this gives access to attributes like the user's avatar.
Is this the right way to go about doing this? Or is the data accessible some other way? Thanks!
Added social auth response data to session.
For that purpose is the extra data processing, check the doc at http://django-social-auth.readthedocs.org/en/latest/backends/oauth.html, basically you define in that setting the key names of data you want to store in the UserSocialAuth instance.
I knew there had to be a better way, thanks! However, I'm not understanding the documentation. 😕
I'm looking to get some extra values from GitHub's OAuth response. For example, below is a subset of GitHub's response data:
'name': 'Roberto Aguilar',
The documentation states to define the setting GITHUB_EXTRA_DATA to access this stuff. From the page you reference, I did not understand why there is a need for a list of 2-tuples, nor where I access this data from once I define it. I added the following to my settings:
GITHUB_EXTRA_DATA = [
Now that I've configured GITHUB_EXTRA_DATA to give me access to avatar_url, how do I access it?
The two-tuples are in the form key name in response, alias value to store it, the alias was added to uniform the retrieved data between providers, for example if you use Github and Facebook backends, you will know that given any UserSocialAuth instance, you will find the avatar under a same key and avoid any backend-type check to use the correct key.
key name in response
alias value to store it
Once the data is stored, you can access it under the extra_data attribute in the UserSocialAuth instance, for example, given a user instance you can get it in this way:
@omab, thanks, got it working. I'm opening up another PR for some doc enhancement.