Skip to main content

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.

Metadata

Release files for django-creta-auth 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-creta-auth 0.2.1
File Size Uploaded
django-creta-auth-0.2.1.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-creta-auth 0.2.1
File Interpreter ABI Platform
django_creta_auth-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 24.8 kB

Release files / django-creta-auth-0.2.1.tar.gz

Download URL django-creta-auth-0.2.1.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6500b0e577d3ad639d1aa48ecaca34d96ef2a4e7afd630ed931e040a8f7410c2
BLAKE2b-256 checksum
How to use checksums
260d40ca294fbb2644810917c4ba14989020640f7e466758a52c2fbc2692f56b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.18

Release files / django_creta_auth-0.2.1-py3-none-any.whl

Download URL django_creta_auth-0.2.1-py3-none-any.whl
Size 13.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c510e474428bb4e45976a6dfa6a527aa8d17da42be5c93a7adf88a890d8dc05e
BLAKE2b-256 checksum
How to use checksums
ed1c9994febffe228d4e2585c244ec6e9da72b7b4cd1984807a508c4c412b4e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.8.18

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page