django-rest-social-auth | OAuth signin with django rest framework | Authentication library

 by   st4lk Python Version: v8.0.0 License: MIT

kandi X-RAY | django-rest-social-auth Summary

kandi X-RAY | django-rest-social-auth Summary

django-rest-social-auth is a Python library typically used in Security, Authentication applications. django-rest-social-auth has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can install using 'pip install django-rest-social-auth' or download it from GitHub, PyPI.

[Downloads] OAuth signin with django rest framework.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              django-rest-social-auth has a low active ecosystem.
              It has 471 star(s) with 119 fork(s). There are 15 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 33 open issues and 67 have been closed. On average issues are closed in 100 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of django-rest-social-auth is v8.0.0

            kandi-Quality Quality

              django-rest-social-auth has 0 bugs and 0 code smells.

            kandi-Security Security

              django-rest-social-auth has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              django-rest-social-auth code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              django-rest-social-auth is licensed under the MIT License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              django-rest-social-auth releases are available to install and integrate.
              Deployable package is available in PyPI.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.

            Top functions reviewed by kandi - BETA

            kandi has reviewed django-rest-social-auth and discovered the below as its top functions. This is intended to give you an instant insight into django-rest-social-auth implemented functionality, and help decide if they suit your requirements.
            • Handle POST requests
            • Get redirect URI
            • Returns the object object
            • Do login
            • Get access token
            • Get a JWT token instance
            • Get token payload
            • Save a social avatar
            • Check if an email is provided
            • Get refresh token
            • Get the token
            Get all kandi verified functions for this library.

            django-rest-social-auth Key Features

            No Key Features are available at this moment for django-rest-social-auth.

            django-rest-social-auth Examples and Code Snippets

            No Code Snippets are available at this moment for django-rest-social-auth.

            Community Discussions

            QUESTION

            How do I associate multiple python-social-auth social accounts with an existing user via REST api?
            Asked 2020-Aug-12 at 16:55

            I'm using python-social-auth to allow my users to register via Apple and Google. I'm trying to figure out how via REST I can associate social accounts to an existing user with a different email than the social account (project req is that users are manually created in the backend and then can associate a social login for ease-of-access). This is a React Native app so the usual automatic way of active sessions won't work. I'm using https://github.com/st4lk/django-rest-social-auth to create easy endpoints.

            Thanks in advance y'all.

            ...

            ANSWER

            Answered 2020-Aug-12 at 16:55

            I got it working. I ended up doing this by creating an associated_email field on profile model for each social auth service, and writing a customized version of associate by email step in the pipeline that verifies against that field.

            Thanks y'all.

            Source https://stackoverflow.com/questions/63322513

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install django-rest-social-auth

            Install this package to your python distribution:. Make sure everything is up do date. Include rest social urls (choose at least one). You are ready to login users.
            Install this package to your python distribution: ```bash pip install rest-social-auth ```
            Do the settings Install apps ```python INSTALLED_APPS = ( ... 'rest_framework', 'rest_framework.authtoken', # only if you use token authentication 'social_django', # django social auth 'rest_social_auth', # this package 'knox', # Only if you use django-rest-knox ) ``` social auth settings, look [documentation](http://python-social-auth.readthedocs.io/en/latest/configuration/django.html) for more details ```python SOCIAL_AUTH_FACEBOOK_KEY = 'your app client id' SOCIAL_AUTH_FACEBOOK_SECRET = 'your app client secret' SOCIAL_AUTH_FACEBOOK_SCOPE = ['email', ] # optional SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {'locale': 'ru_RU'} # optional AUTHENTICATION_BACKENDS = ( 'social_core.backends.facebook.FacebookOAuth2', # and maybe some others ... 'django.contrib.auth.backends.ModelBackend', ) ``` Also look [optional settings](#settings) avaliable.
            Make sure everything is up do date ```bash python manage.py migrate ```
            Include rest social urls (choose at least one) 4.1 [session authentication](http://www.django-rest-framework.org/api-guide/authentication/#sessionauthentication) ```python path('api/login/', include('rest_social_auth.urls_session')), ``` 4.2 [token authentication](http://www.django-rest-framework.org/api-guide/authentication/#tokenauthentication) ```python path('api/login/', include('rest_social_auth.urls_token')), ``` 4.3 [jwt authentication](https://github.com/davesque/django-rest-framework-simplejwt) ```python path('api/login/', include('rest_social_auth.urls_jwt_pair')), ``` or / and ```python path('api/login/', include('rest_social_auth.urls_jwt_sliding')), ``` 4.4 [knox authentication](https://github.com/James1345/django-rest-knox/) ```python path('api/login/', include('rest_social_auth.urls_knox')), ```
            You are ready to login users Following examples are for OAuth 2.0. 5.1 session authentication POST /api/login/social/session/ input: { "provider": "facebook", "code": "AQBPBBTjbdnehj51" } output: { "username": "Alex", "email": "user@email.com", // other user data } + session id in cookies 5.2 token authentication POST /api/login/social/token/ input: { "provider": "facebook", "code": "AQBPBBTjbdnehj51" } output: { "token": "68ded41d89f6a28da050f882998b2ea1decebbe0" } POST /api/login/social/token_user/ input: { "provider": "facebook", "code": "AQBPBBTjbdnehj51" } output: { "username": "Alex", "email": "user@email.com", // other user data "token": "68ded41d89f6a28da050f882998b2ea1decebbe0" } 5.3 jwt authentication (using [django-rest-framework-simplejwt](https://github.com/davesque/django-rest-framework-simplejwt)) POST /api/login/social/jwt-pair/ POST /api/login/social/jwt-pair-user/ Similar to token authentication, but token is JSON Web Token. See [JWT.io](http://jwt.io/) for details. To use it, django-rest-framework-simplejwt must be installed. For `jwt-pair`, the response will include additional "refresh" token: ```json { "token": "...", "refresh": "..." } ``` ##### Or sliding JWT token: POST /api/login/social/jwt-sliding/ POST /api/login/social/jwt-sliding-user/ Check [docs of simplejwt](https://github.com/davesque/django-rest-framework-simplejwt#token-types) for pair/sliding token difference. Note. `django-rest-framework-simplejwt` doesn't work on python3.6 5.4 knox authentication POST /api/login/social/knox/ POST /api/login/social/knox_user/ Similar to token authentication, but token is Django Rest Knox Token. To use it, [django-rest-knox](https://github.com/James1345/django-rest-knox/) must be installed. User model is taken from [`settings.AUTH_USER_MODEL`](https://docs.djangoproject.com/en/dev/topics/auth/customizing/#substituting-a-custom-user-model). At input there is also non-required field `redirect_uri`. If given, server will use this redirect uri in requests, instead of uri got from settings. This redirect_uri must be equal in front-end request and in back-end request. Back-end will not do any redirect in fact. It is also possible to specify provider in URL, not in request body. Just append it to the url: POST /api/login/social/session/facebook/ Don't need to specify it in body now: { "code": "AQBPBBTjbdnehj51" } Provider defined in URL has higher priority than provider in body. If both are specified - provider will be taken from URL.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/st4lk/django-rest-social-auth.git

          • CLI

            gh repo clone st4lk/django-rest-social-auth

          • sshUrl

            git@github.com:st4lk/django-rest-social-auth.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Authentication Libraries

            supabase

            by supabase

            iosched

            by google

            monica

            by monicahq

            authelia

            by authelia

            hydra

            by ory

            Try Top Libraries by st4lk

            django-affiliate

            by st4lkPython

            acl_webapp

            by st4lkPython

            lexev

            by st4lkPython