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

Uploaded Python 3

File details

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

File metadata

  • Download URL: django_openstax_accounts-1.2.0.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.2.0.tar.gz
Algorithm Hash digest
SHA256 b2e8951b6bdd38b9695f0181b65fb922d167889ad669d44eaedcfc0a307c0229
MD5 9309e23f1171de4707ca896a07e0d01c
BLAKE2b-256 1e9daf991e89f68c82a7451331d96a0fbd5835ea03ddb4b6905feff97b7b5b90

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for django_openstax_accounts-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d2f4bb1ea010ba91997baa8acd625a5aa56c84341d15197e0d5a7b534ee1f8f9
MD5 182f50b39fbfb91fbc9d3ac9970bb2b5
BLAKE2b-256 28d4ea60fd13cf014f4bad582bbfc1db5280ab113dc8d09fec21c09cf453f886

See more details on using hashes here.

Provenance

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