Skip to main content

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
ORY_UI_URL=https://projectId.projects.oryapis.com/ui
LOGIN_URL=https://projectId.projects.oryapis.com/ui/login

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",
    ...
]

Using context processors

The package provides context processor to provide the following urls

  • login_url
  • logout_url (for authenticated users)
  • signup_url
  • recovery_url
  • verify_url
  • profile_url (available for authenticated users)

to enable context processor add django_ory_auth.context.processor to the context_processor setting

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

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_ory_auth-0.1.3-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file django_ory_auth-0.1.3.tar.gz.

File metadata

  • Download URL: django_ory_auth-0.1.3.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Darwin/21.4.0

File hashes

Hashes for django_ory_auth-0.1.3.tar.gz
Algorithm Hash digest
SHA256 2d60a2aacc488c6405b8470df574341a21bc4f2b8fc6ce4751a4d61b83689165
MD5 9f1b0604be9ec666a72c8132ac63fbf1
BLAKE2b-256 d1e31c74f223c09c475d2a57f07eb5d45b87ffbeef49308213bb00d7f4db08f1

See more details on using hashes here.

File details

Details for the file django_ory_auth-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: django_ory_auth-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.10.4 Darwin/21.4.0

File hashes

Hashes for django_ory_auth-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c0d7aea0269831a90e194dbba973a671d30ded481efd0898a8062530bd72c626
MD5 eaffb060e7446547be22cc3a3540f181
BLAKE2b-256 459b0feb5c34e81314d40bfb1b0072577f49cd414f3cc5807b21225d1c406ca5

See more details on using hashes here.

Supported by

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