mirror of
https://github.com/Tivix/django-rest-auth.git
synced 2025-02-16 18:00:35 +03:00
Adjusted phrasing and layout of social integration examples
This commit is contained in:
parent
b6e991e787
commit
bb7b1270b7
|
@ -65,11 +65,11 @@ Registration (optional)
|
||||||
Social Authentication (optional)
|
Social Authentication (optional)
|
||||||
--------------------------------
|
--------------------------------
|
||||||
|
|
||||||
Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creating social media authentication view. Below is an example with Facebook authentication.
|
Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creating social media authentication view.
|
||||||
|
|
||||||
.. note:: Points 1, 2 and 3 are related with ``django-allauth`` configuration, so if you have already configured social authentication, then please go to step 4. See ``django-allauth`` documentation for more details.
|
.. note:: Points 1 and 2 are related to ``django-allauth`` configuration, so if you have already configured social authentication, then please go to step 3. See ``django-allauth`` documentation for more details.
|
||||||
|
|
||||||
1. Add ``allauth.socialaccount`` and ``allauth.socialaccount.providers.facebook`` apps to INSTALLED_APPS in your django settings.py:
|
1. Add ``allauth.socialaccount`` and ``allauth.socialaccount.providers.facebook`` or ``allauth.socialaccount.providers.twitter`` apps to INSTALLED_APPS in your django settings.py:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
@ -91,6 +91,9 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
|
||||||
|
|
||||||
2. Add Social Application in django admin panel
|
2. Add Social Application in django admin panel
|
||||||
|
|
||||||
|
Facebook
|
||||||
|
########
|
||||||
|
|
||||||
3. Create new view as a subclass of ``rest_auth.registration.views.SocialLoginView`` with ``FacebookOAuth2Adapter`` adapter as an attribute:
|
3. Create new view as a subclass of ``rest_auth.registration.views.SocialLoginView`` with ``FacebookOAuth2Adapter`` adapter as an attribute:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
@ -110,11 +113,13 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
|
||||||
url(r'^rest-auth/facebook/$', FacebookLogin.as_view(), name='fb_login')
|
url(r'^rest-auth/facebook/$', FacebookLogin.as_view(), name='fb_login')
|
||||||
)
|
)
|
||||||
|
|
||||||
5. If you are using Twitter for your social authentication, it is a bit different from
|
|
||||||
Facebook since Twitter uses OAuth 1.0.
|
|
||||||
|
|
||||||
|
Twitter
|
||||||
|
#######
|
||||||
|
|
||||||
6. Create new view as a subclass of ``rest_auth.views.LoginView`` with ``TwitterOAuthAdapter`` adapter and ``TwitterLoginSerializer`` as an attribute:
|
If you are using Twitter for your social authentication, it is a bit different since Twitter uses OAuth 1.0.
|
||||||
|
|
||||||
|
3. Create new view as a subclass of ``rest_auth.views.LoginView`` with ``TwitterOAuthAdapter`` adapter and ``TwitterLoginSerializer`` as an attribute:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
@ -126,7 +131,7 @@ Using ``django-allauth``, ``django-rest-auth`` provides helpful class for creati
|
||||||
serializer_class = TwitterLoginSerializer
|
serializer_class = TwitterLoginSerializer
|
||||||
adapter_class = TwitterOAuthAdapter
|
adapter_class = TwitterOAuthAdapter
|
||||||
|
|
||||||
7. Create url for TwitterLogin view:
|
4. Create url for TwitterLogin view:
|
||||||
|
|
||||||
.. code-block:: python
|
.. code-block:: python
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user