Module for use ksu sso service
Project description
Установка
pip install ksu-sso-auth
Настройка
В 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.5.tar.gz
(6.4 kB
view details)
Built Distribution
File details
Details for the file ksu_sso_auth-0.1.5.tar.gz
.
File metadata
- Download URL: ksu_sso_auth-0.1.5.tar.gz
- Upload date:
- Size: 6.4 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 | 4320edbe28cdcec004265af0875fa49e49f3506758d7c621a5f0d79f9239dfc5 |
|
MD5 | bbd621bdd6fcb52e56bf1d881131d3b7 |
|
BLAKE2b-256 | f7c9fc83286a6427b3633776278e90b396cccadcccff78c52bacdefb86572c9c |
File details
Details for the file ksu_sso_auth-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: ksu_sso_auth-0.1.5-py3-none-any.whl
- Upload date:
- Size: 12.0 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 | e8c6ecedcaad522cbbf5526b18d0d7d54190a46b7832b741fab9fb084e20e528 |
|
MD5 | c0849e79e889d60094267c7c8acf09fd |
|
BLAKE2b-256 | 27a8f84bd153534905b2dd938758d5ce7e545b3f1d6228f333055b7c590c676a |