Module for use ksu sso service
Project description
Настройка
В settings проекта добавить:
- 'sso_auth' в INSTALLED_APPS
После этого выполнить команды
python3 manage.py makemigrations sso_auth
python3 manage.py migrate
Добавить в urls.py проекта в переменную urlpatterns выше всего остального следующий код:
path('admin/login/', AdminLogin.as_view()),
path('admin/logout/', UserLogout.as_view()),
path('sso/', include('sso_auth.urls')),
До этого сделать импорт:
from django.urls import path, include
from sso_auth.views import AdminLogin, UserLogout
В settings проекта добавить:
- 'sso_auth.middleware.OauthMiddleware' в MIDDLEWARE
- код ниже. нужно заполнить реальными данными от сервера авторизации
# settings for sso login
AUTH_USER_MODEL = 'sso_auth.OauthUser'
AUTHENTICATION_BACKENDS = ('sso_auth.backends.TokenAuth',)
SSO_URL = 'http://127.0.0.1:8000/oauth/'
CLIENT_ID = '1bc2aea0-4dad-4f4a-9f3d-4e205b0fc10a'
CLIENT_SECRET = 'Zo8DtoPgu6m533ySFDfBImo0Lao_sh50dxE-EAHJCkwCrNvaPztIsOQaxdB0nKrX11o'
REDIRECT_URI = 'http://127.0.0.1:8001/sso/process'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ksu_sso_auth-0.1.1.tar.gz
(6.3 kB
view details)
Built Distribution
File details
Details for the file ksu_sso_auth-0.1.1.tar.gz
.
File metadata
- Download URL: ksu_sso_auth-0.1.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb4edd5dd7e96b37f5583b2e1a0dd9117579488bff95257f4850688fbca3c4e2 |
|
MD5 | 037eed7974903d27b9fc865c4a36a058 |
|
BLAKE2b-256 | c23c6acc56f3a8c5b6d4914d5daa1579d3fb0c11241d8b22ae6e631116fac017 |
File details
Details for the file ksu_sso_auth-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: ksu_sso_auth-0.1.1-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf693ca98a21341eeaf5eee9db0cf91ee0dff8d9473849b6840be4e5bb8bf208 |
|
MD5 | 8ef72703691953a5cc0d98c5aca419a8 |
|
BLAKE2b-256 | 8892f1c10dd95c96d5ebebdd3eae470204cd01e133229424f90359472ef7384a |