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

Uploaded Source

Built Distribution

ksu_sso_auth-0.0.2-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

Hashes for ksu_sso_auth-0.0.2.tar.gz
Algorithm Hash digest
SHA256 c0a564212cecc7d0c403080db40f5404cdedccc1ab439650e85c80bb4657e0ed
MD5 5d264596d7038a2a40616e9485ca0c55
BLAKE2b-256 82c68dce83f50b7debad2d0e03860338cdff5541c9a8fc5bd9a0b34bcbb6e703

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ksu_sso_auth-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 9.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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4028fb6f1191589a3d747a3f641f5b0c9784bb7a8b1f28fcc3dcf74afd477adc
MD5 dff6d51cf7ec38c55da21a17a536acd4
BLAKE2b-256 cd75ae04135c16b1801f93b7dfcad8b5bfdca619248a5dfd2869b0a75509a649

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