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.1.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.1-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_openstax_accounts-1.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 49e48cdaa7cc887a9c165ff9039598bc3d2b6e0c199cc25879a8b203dd93a8bd
MD5 765ed423cc3be26bdbab946444728f2c
BLAKE2b-256 ab0448c2fdc3317f96a11da7e8635c21089540bfe6cb97151c218af5a9a0bf57

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_openstax_accounts-1.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_openstax_accounts-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fe60cf3dfdf58125e185bdbbbea79389ee159c3901ff8d8600e94817d041058c
MD5 9237bff6c2f833c72190b0763a1d8347
BLAKE2b-256 3b4c81077aed6fb57266b0ba989ffb2dfdff07292c64ab4a4118bd5bc5b73d92

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_openstax_accounts-1.1.1-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