Module for use ksu sso service
Project description
Настройка
Добавить в 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' в INSTALLED_APPS
- 'sso_auth.middleware.OauthMiddleware' в MIDDLEWARE
- код ниже. нужно заполнить реальными данными от сервера авторизации
# settings for sso login
AUTH_USER_MODEL = 'sso_auth.OauthUser'
AUTHENTICATION_BACKENDS = ('sso_auth.backends.TokenAuth', 'django.contrib.auth.backends.ModelBackend')
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.0.3.tar.gz
(5.9 kB
view details)
Built Distribution
File details
Details for the file ksu_sso_auth-0.0.3.tar.gz
.
File metadata
- Download URL: ksu_sso_auth-0.0.3.tar.gz
- Upload date:
- Size: 5.9 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 | 89b1a3118c9e3c5fb722a9109af1a6801ba0c78f82343de5f82994be68d7e58d |
|
MD5 | b6c8ee0c9eb80947481d50ba88fc5da2 |
|
BLAKE2b-256 | 9efb1d8b20648c8f47a46ee9651c6463007bfb35e0538229edeaf135ae352d45 |
File details
Details for the file ksu_sso_auth-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: ksu_sso_auth-0.0.3-py3-none-any.whl
- Upload date:
- Size: 13.3 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 | 71622afee65b86080f62280d5c30bd0de832791a8a7366d8bfaa78a0c2974841 |
|
MD5 | 952bcf20570d6511672f73fe12d7e972 |
|
BLAKE2b-256 | 3a13e407a345eeca4c485423d21426e89fc86b8e2a39382b5f2f65b765f5682f |