Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_social_oauth_token-2.2.0.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file django_social_oauth_token-2.2.0.tar.gz.

File metadata

  • Download URL: django_social_oauth_token-2.2.0.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.8 Linux/5.15.0-1022-azure

File hashes

Hashes for django_social_oauth_token-2.2.0.tar.gz
Algorithm Hash digest
SHA256 9a5a44a938df4130cc4ebf86694bf627aceaf9de5a0d78278d1b15083d42d606
MD5 a594ea124ca79546d85d42584ac1747d
BLAKE2b-256 dfa59c17995d5d74b97c26a7b35cf88227af0efdd0ba59cfc4c772255d2b069a

See more details on using hashes here.

File details

Details for the file django_social_oauth_token-2.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_social_oauth_token-2.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 85b4b871358dc0fc0a8ca6bb7691bd367878f3e442d326945f77f932dc1e1a59
MD5 522c47da14f7960d112e3ed984abbd5b
BLAKE2b-256 8a7e30c2f99e83ca5b2c67c37715955b9d64831d7dde44f82207f34f2dff3126

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page