1

I need to pass data through a social authentication (so I can access it after the login is complete) using django-allauth, but I'm not sure how to go about doing this as the documentation seems to be completely lacking in this area.

From what I gather, OAuth2 accepts a state parameter that can be used to transfer this sort of data. After spending hours trolling through the django-allauth code, it appears that there might be some ability to append a dynamic state parameter. However, I have no idea what the proper way to introduce this data into the request is, nor at what point this should occur. Do I need to monkey patch something in socialaccounts/views.py? Unfortunately it doesn't seems like the socialaccounts adapter.py has any way to hook into a request like this.

Edit: It looks like there's also some opportunity to access the state parameter here, but again, I'm unsure of the best way to do this.

Gravity Grave
  • 2,802
  • 1
  • 27
  • 39

1 Answers1

3

It turns out the state parameters were a red herring; however, django-allauth passes the Django session ID through OAuth requests. This allows you to store data safely in request.session before the authentication occurs, and then access it again later after authentication is complete.

Gravity Grave
  • 2,802
  • 1
  • 27
  • 39