Coder Social home page Coder Social logo

dulmandakh / django-social-oauth-token Goto Github PK

View Code? Open in Web Editor NEW

This project forked from khasbilegt/django-social-oauth-token

0.0 2.0 0.0 49 KB

OAuthToken generation API for handling OAuth 2.0 Authentication Code Flow based on python-social-auth

License: MIT License

Python 100.00%

django-social-oauth-token's Introduction

django-social-oauth-token

ci status pypi link codecov
supported python versions supported django versions

InstallationContributingHow To UseLicense

OAuthToken generation API for handling OAuth 2.0 Authentication Code Flow based on social-auth

Installation

  1. Use your preferred package manager (pip, poetry, pipenv) to install the package. For example:
$ poetry add django-social-oauth-token
  1. Then register 'social_oauth_token', in the 'INSTALLED_APPS' section of your project's settings.
# settings.py
...

INSTALLED_APPS = (
    ...
    'social_oauth_token',
)

...
  1. Include the urlpatterns in your main urls file.
# urls.py

urlpatterns = [
  ...
  path("social_oauth_token/", include("social_oauth_token.urls", namespace="social_oauth_token")),
  ...
]

How To Use

In order to verify the Authorization Code sent by the user and replace it with your own OAuth Access Token, send a POST request to the token/<backend>/ endpoint with client_id and code to receive the token.

The POST request parameters:

client_id # OAuth Client ID
code # Authorization Code

The JSON response:

{
  "access_token": <access_token>,
  "expires_in": <expires_in>,
  "token_type": <token_type>,
  "refresh_token": <refresh_token>,
}

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT License

django-social-oauth-token's People

Contributors

khasbilegt avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.