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')

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

Uploaded Source

Built Distribution

kodland_sso_client-0.2.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kodland_sso_client-0.2.0.tar.gz
  • Upload date:
  • Size: 5.1 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.0.tar.gz
Algorithm Hash digest
SHA256 44b80b100f013bd462de885d82c1bf60050d3d4173d10b24527aadfac4a15cc2
MD5 a38bbf58a52095cb6d84c44e0d4b5be3
BLAKE2b-256 0ea1fa19051ca92490d05294e2629d4a1527d0b7fdbef031591e4cf6b2b5b745

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kodland_sso_client-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 9.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 304ce5ed867ba8b77172e7aacb118fb2630c1f74d73c2117f6afdde4807b3b88
MD5 112188a094297328f4b2cb67afc22808
BLAKE2b-256 9eb29a8ed12c04110ebe1976e2cf690b5343ac3dc9c9bc7181e0361e09042e17

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