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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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