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.5.tar.gz
(5.6 kB
view details)
Built Distribution
File details
Details for the file ksu_sso_auth-0.0.5.tar.gz
.
File metadata
- Download URL: ksu_sso_auth-0.0.5.tar.gz
- Upload date:
- Size: 5.6 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 | 801f491bba2253cd948457cef6085d726dea358065eb00a27b8eaae6adc16ce0 |
|
MD5 | b0fb1c9220ed08c9e8a582a4095f5b40 |
|
BLAKE2b-256 | fc303aa285b097865d2e4ab6ec3f2e91dfc235bd74949d493abbef2e97fe8857 |
File details
Details for the file ksu_sso_auth-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: ksu_sso_auth-0.0.5-py3-none-any.whl
- Upload date:
- Size: 10.5 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 | cb53f14662adebf76ee7621300b4ac581b9234d172c3ebc2933b17357c9e2f41 |
|
MD5 | a6e01d0f0936515edf070d89f146cee0 |
|
BLAKE2b-256 | 001e7e0ab2af2de03941ae406035a1af36723721f0e12ec08301ab1d8066e91d |