A boilerplate Django app package for easy integration
Project description
django_creta_auth
Current version: 0.1.6
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
- Add django_creta_auth to your INSTALLED_APPS in settings.py:
INSTALLED_APPS = [
...,
'django_creta_auth'
]
- Include the django_creta_auth URLs in your urls.py:
from django.urls import path, include
urlpatterns = [
...,
path('auth/', include('django_creta_auth.urls')),
]
- Run
python manage.py migrate
Create the models.
CRETA_AUTH_BASE_URL = 'https://....'
- 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
Built Distribution
File details
Details for the file django-creta-auth-0.1.6.tar.gz
.
File metadata
- Download URL: django-creta-auth-0.1.6.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b23ad6ddc00f45c880af9aa8a0ba30e5b95212f882be55996aec0cc9f18a2c8 |
|
MD5 | 4d3f6611201445304a2972a10b996cb9 |
|
BLAKE2b-256 | a9ca69b39bd96c7f3574bdb38c2124a3b1a64c67d3c47ce68c97cab4fda8216d |
File details
Details for the file django_creta_auth-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: django_creta_auth-0.1.6-py3-none-any.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.8.18
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54c5b902484e8ae3bb79778a15b24ec3768bd6590dbad0e0193b7769adac6f13 |
|
MD5 | d036054a4ce825873be56c9a72ba22c6 |
|
BLAKE2b-256 | 8373cf6b653f257b4b01ca70b7bceadbaf3b94bac779eab0662c8e97ae857cd1 |