Skip to main content

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


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.4.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

ksu_sso_auth-0.0.4-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file ksu_sso_auth-0.0.4.tar.gz.

File metadata

  • Download URL: ksu_sso_auth-0.0.4.tar.gz
  • Upload date:
  • Size: 4.7 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

Hashes for ksu_sso_auth-0.0.4.tar.gz
Algorithm Hash digest
SHA256 ce1c97ab6f5a8f31f6583c6b53ab40bbcbc7d0516ffaa28755b5598f3781b56f
MD5 40d94485eab146e6a0d87c0d930868ba
BLAKE2b-256 c26218410a885a05e8f5470e767f51afd24a09191db49cc48f3ca1feea739479

See more details on using hashes here.

File details

Details for the file ksu_sso_auth-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: ksu_sso_auth-0.0.4-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

Hashes for ksu_sso_auth-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 34aed468a381a4232593d67be81a107ce6e115fa77e42be5ae480a2fbee96d75
MD5 8a903866890b74e3ca7ffd564a30eb3c
BLAKE2b-256 63287701dbd0b70d445c7decc953b2e3811b9689b38e3af54eff2644d7d06ec8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page