pennersr / django-allauth

Integrated set of Django applications addressing authentication, registration, account management as well as 3rd party (social) account authentication.
https://allauth.org
MIT License
9.42k stars 3.01k forks source link

Integrate with php project #406

Closed watermelonlh closed 10 years ago

watermelonlh commented 10 years ago

I am using https://github.com/winhamwr/django-php-bridge to integrate a php project into my django project. They share the same authentication, which is I implemented in django by all-auth.

For now, the django-php-bridge is simply serialize the session into php-style and stored in db to provide for php side. It works fine with all-auth local user, but will get fail for all socail account.

the django server will report like [WARNING] [django.request:162] Forbidden (Permission denied): /accounts/github/login/callback/

I am wondering the socailaccount session is implemented different from local account? Could you please give some advice on this issue? thx a lot!

pennersr commented 10 years ago

This may be due to #386 -- before this ticket got fixed, the SocialLogin got serialized (pickled) directly. I suspect that the PHP bridge cannot handle this. Now that #386 is fixed the session only contains plain data types. Could you try using current master?

watermelonlh commented 10 years ago

Thank pennersr. I found the reason today. Since the django-php-bridge use phpserializer as backend to serialize & deserialize the session_data in django, so it will translate tuple & list to dict. It lead to error in this line https://github.com/pennersr/django-allauth/blob/master/allauth/socialaccount/models.py#L283 , because it is dict not tuple. I've edited django-php-bridge's code to fix it.

Thanks again for your great job on all-auth!