A django package to enable integration with Ory Cloud
Project description
Ory Django
This package provides integration with Ory Cloud or Ory Kratos for your django application
Installing
You can simply run
pip install django_ory_auth
or
poetry add django_ory_auth
or
pipenv install django_ory_auth
Add django_ory_auth
to INSTALLED_APPS
INSTALLED_APPS = [
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sites",
"django_ory_auth"
]
Configuration
You need to add these variables to your settings
ORY_SDK_URL=https://projectId.projects.oryapis.com
LOGIN_URL=https://projectId.projects.oryapis.com/ui/login
LOGOUT_URL=https://projectId.projects.oryapis.com/logout
django_ory_auth
provides authentication backend. You must replace ModelBackend
with OryBackend
in the AUTHENTICATION_BACKENDS
setting
AUTHENTICATION_BACKENDS = [
"django_ory_auth.backend.OryBackend",
]
Last step is to add django_ory_auth.middleware.AuthenticationMiddleware
under django.contrib.auth.middleware.AuthenticationMiddleware
MIDDLEWARE = [
…
"django.contrib.auth.middleware.AuthenticationMiddleware",
"django_ory_auth.middleware.AuthenticationMiddleware",
...
]
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
django_ory_auth-0.1.2.tar.gz
(7.1 kB
view hashes)
Built Distribution
Close
Hashes for django_ory_auth-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f77192b7b8c49ca52906422c0bd181a5a49aa251d279f421709feaf3aae03ee |
|
MD5 | 06cfa690a2859b59631271def2c4e49c |
|
BLAKE2b-256 | 4882541dcc857894fc8562e5c10b6598b4805407892eee8161b44893d247ae45 |