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


Release history Release notifications | RSS feed

This version

1.0

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

Uploaded Source

Built Distribution

django_openstax_accounts-1.0-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file django-openstax-accounts-1.0.tar.gz.

File metadata

File hashes

Hashes for django-openstax-accounts-1.0.tar.gz
Algorithm Hash digest
SHA256 30eba7404f71d1bd66eede2b34b6f5721e9477d5899100ba17ee8bc79525d96e
MD5 371e995302ad734b4001b98f10b7a4a2
BLAKE2b-256 5f3188a0318b4edabde8cb1e09b935643b76e83d4de156a5de9901b250b6b287

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_openstax_accounts-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 03bd0307d96f3494660b41029ccf7e14f081077e3fc76ffba55263b69a4c12f2
MD5 52f6ccd99fb0152ea6936172dfa7c3c3
BLAKE2b-256 2127f41f5b939cf1accde29c802ef82e9ea2bec1e8cc129dc2719ca90587fbfe

See more details on using hashes here.

Supported by

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