Skip to main content

A boilerplate Django app package for easy integration

Project description

django_creta_auth

Current version: 0.2.1

Boilerplate for a Django Package

1. Installation

The preferred installation method is directly from pypi:

# Install the package.
$ pip install -U django_creta_auth

Quickstart

  1. Add django_creta_auth to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
    ...,
    'django_creta_auth'
]
  1. Include the django_creta_auth URLs in your urls.py:
from django.urls import path, include

urlpatterns = [
    ...,
    path('auth/', include('django_creta_auth.urls')),
]
  1. Run python manage.py migrate Create the models.
CRETA_AUTH_BASE_URL = 'https://....'
  1. Run python manage.py migrate Create the models.
$ python manage.py migrate

Usage

Endpoints

  • Register User: POST /auth/register/
  • Login User: POST /auth/login/
  • Reset Password: POST /auth/reset-password/
  • Update Password: POST /auth/update-password/
  • Send Verification Key: POST /auth/send-verification-key/
  • Verify Key: GET /auth/verify-key/
  • Find Existing User: GET /auth/find-existing-user/
  • Send Password Reset: POST /auth/send-password-reset/
  • Verify Password Reset: GET /auth/verify-password-reset/
  • Validate Session: GET /auth/validate-session/
  • Refresh Session: POST /auth/refresh-session/
  • Logout User: POST /auth/logout/
  • Google OAuth Login: GET /auth/oauth/google/
  • Apple OAuth Login: GET /auth/oauth/apple/
  • Upsert OAuth User: POST /auth/oauth/upsertUser/ Gateway Functions The gateway.py module provides functions to interact with the authentication API directly.

Functions

  • register_user(email, password, name, is_two_factor, email_verified_at): Registers a new user.
  • login_user(email, password): Logs in a user.
  • reset_password(email, key, password): Resets the user's password.
  • update_password(session_token, old_password, new_password): Updates the user's password.
  • send_verification_key(email, call_back_url): Sends a verification key to the user's email.
  • verify_key(email, key): Verifies the key sent to the user's email.
  • find_existing_user(email): Checks if a user with the given email exists.
  • send_password_reset(email, call_back_url): Sends a password reset link to the user's email.
  • verify_password_reset(email, key): Verifies the password reset key.
  • validate_session(session_token): Validates the session token.
  • refresh_session(refresh_token): Refreshes the session token.
  • logout_user(session_token): Logs out the user.
  • google_oauth_login(origin_url): Logs in using Google OAuth.
  • apple_oauth_login(origin_url): Logs in using Apple OAuth.
  • upsert_oauth_user(provider, provider_user_id, access_token, refresh_token, name, picture_url, email): Upserts a user using OAuth.

Contributes

The MIT License

Copyright (c) 2023 Runners Co., Ltd.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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-creta-auth-0.2.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

django_creta_auth-0.2.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file django-creta-auth-0.2.1.tar.gz.

File metadata

  • Download URL: django-creta-auth-0.2.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.8.18

File hashes

Hashes for django-creta-auth-0.2.1.tar.gz
Algorithm Hash digest
SHA256 6500b0e577d3ad639d1aa48ecaca34d96ef2a4e7afd630ed931e040a8f7410c2
MD5 165de16e1addc2f3ba55d533511e6283
BLAKE2b-256 260d40ca294fbb2644810917c4ba14989020640f7e466758a52c2fbc2692f56b

See more details on using hashes here.

File details

Details for the file django_creta_auth-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_creta_auth-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c510e474428bb4e45976a6dfa6a527aa8d17da42be5c93a7adf88a890d8dc05e
MD5 2d956dd2c389b9a58c328d4c330ccb65
BLAKE2b-256 ed1c9994febffe228d4e2585c244ec6e9da72b7b4cd1984807a508c4c412b4e8

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