Skip to main content

A Django app to read data from the logged-in user OpenStax account using the SSO cookie.

Project description

django-openstax-accounts is a Django app to read data from the logged-in user’s OpenStax account using the SSO cookie.

Quick start

Add the following settings to your settings file:

# OpenStax Accounts settings
SSO_COOKIE_NAME = "<oxa_env>"
SSO_SIGNATURE_PUBLIC_KEY = "<public_key_for_accounts>"
SSO_ENCRYPTION_PRIVATE_KEY = "<private_key_for_accounts>"

Usage

If you need to access the current user’s OpenStax account UUID, you can use the get_logged_in_user_uuid function from openstax_accounts.functions. This function will a UUID.:

from django.shortcuts import render
from openstax_accounts.functions import get_logged_in_user_uuid

def my_view(request):
    user_uuid = get_logged_in_user_uuid(request)
    # function to do something with the uuid, like save it to your database or use for an API call
    return render(request, "my_template.html", {"user_uuid": user_uuid})

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_openstax_accounts-1.1.2.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

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

django_openstax_accounts-1.1.2-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file django_openstax_accounts-1.1.2.tar.gz.

File metadata

  • Download URL: django_openstax_accounts-1.1.2.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_openstax_accounts-1.1.2.tar.gz
Algorithm Hash digest
SHA256 74db3bf3be210bd84fe872fa7539acb0a352967556a757b59667ba84aff95901
MD5 dc1f5d59c85451229aff7e54188556d0
BLAKE2b-256 6686aad390b8893a2b633a74189d4642dae11c7161937c1a3d180f2cd394cce7

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_openstax_accounts-1.1.2.tar.gz:

Publisher: publish-to-pypi.yml on openstax/django-openstax-accounts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_openstax_accounts-1.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_openstax_accounts-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 010bda5e5d8ad4cf66a7be4aea850bee231768e95581403b29abdb9efd8899fc
MD5 583d55a80ac33602299967e1162a813f
BLAKE2b-256 ab4cd43cb41dfd21e9ff3f9f665e4ce89399c966251ceff742e44bd13fe342e0

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_openstax_accounts-1.1.2-py3-none-any.whl:

Publisher: publish-to-pypi.yml on openstax/django-openstax-accounts

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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