Skip to main content

Django sso client package for Kodland

Project description

Для работы пакета нужен установленный RabbitMQ.
Обмен с сервером идет через очереди.

После установки

Добавить приложение в список INSTALLED_APPS проекта:

INSTALLED_APPS = [
    ...
    'sso_client'
]

Выполнить миграции:

python manage.py migrate

Добавить в settings.py следующие строки:

import os
import pika
# settings for sso login
AUTH_USER_MODEL = 'sso_client.OauthUser'
AUTHENTICATION_BACKENDS = ('sso_client.backends.TokenAuth', )
SSO_URL = '{адрес sso сервера}/sso/'
LOGIN_URL = '{адрес на sso сервере для логина}'

# корневой домен для cookies
SESSION_COOKIE_DOMAIN = '.local'

JWT_SECRET = os.environ.get('JWT_SECRET')

# если установить в True, то общение с sso сервером авторизации 
# для получения данных пользователя будет через RabbitMQ
RABBIT_ON = False

RABBIT_PARAMS = {
    'host': os.environ.get('RABBIT_HOST', 'localhost'),
    'port': os.environ.get('RABBIT_PORT', 5672),
    'credentials': pika.PlainCredentials(os.environ.get('RABBIT_USER', 'guest'), os.environ.get('RABBIT_PASSWORD', 'guest'))
}

Добавить в секцию middleware:

'sso_client.middleware.CheckTokenMiddleware',
'sso_client.middleware.AuthMiddleware'

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

kodland_sso_client-0.2.1.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

kodland_sso_client-0.2.1-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file kodland_sso_client-0.2.1.tar.gz.

File metadata

  • Download URL: kodland_sso_client-0.2.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for kodland_sso_client-0.2.1.tar.gz
Algorithm Hash digest
SHA256 c096c4bde3404a7a9b3e67bca757f40c44ebef78f30b021fd06c32eda1197a85
MD5 d1077311b82480c6a5b5bdc4098c6add
BLAKE2b-256 3cbd0c8cebf25d3a1f1e1a1571e5ef34541a8456ac27d48da172089d411d51d6

See more details on using hashes here.

File details

Details for the file kodland_sso_client-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: kodland_sso_client-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

File hashes

Hashes for kodland_sso_client-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 194d9742cdcea0cd0e123db61b4fef1333b8d01f9713eaced86cd70d3a655114
MD5 b897a94a22c20add3fd25462ffa7fb73
BLAKE2b-256 92a849a01423650bdc69ef9dc2362701a8e4ef9dc4426e064d8e0c4f4cb4ba01

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