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.6.tar.gz
(6.5 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ksu_sso_auth-0.1.6.tar.gz.
File metadata
- Download URL: ksu_sso_auth-0.1.6.tar.gz
- Upload date:
- Size: 6.5 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.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51f03660e8b793ac12587b302413035377882ca8932c5f128f8a31a418b10a61
|
|
| MD5 |
15aeae218bb179cd8596be37300d6c2e
|
|
| BLAKE2b-256 |
5c16d34c6e0cb8521e347053f44ee39fdb3095de410d887df3b8d37685f44002
|
File details
Details for the file ksu_sso_auth-0.1.6-py3-none-any.whl.
File metadata
- Download URL: ksu_sso_auth-0.1.6-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.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
411609ddafa092f81524997bbf732a04b85f6bbf03124fa48730809c8519228e
|
|
| MD5 |
244b64fe6bfc3e24ce4b974ba316210e
|
|
| BLAKE2b-256 |
13551b2cfbb49ade8896c96addf1177348e6ff7cda9698eb001f5b82e595392b
|