andreask
(Andreas)
January 13, 2020, 2:06pm
1
I’m looking for a best practice example for parsing settings from command line to the tpa-saml backend in Django Admin.
I want to run a command like ./manage.py lms create_saml_idp
and then all the variables so they get loaded in Django admin.
Possible?
"""
Slightly customized python-social-auth backend for SAML 2.0 support
"""
import logging
from copy import deepcopy
import requests
from django.contrib.sites.models import Site
from django.http import Http404
from django.utils.functional import cached_property
from django_countries import countries
from onelogin.saml2.settings import OneLogin_Saml2_Settings
from six import text_type
from social_core.backends.saml import OID_EDU_PERSON_ENTITLEMENT, SAMLAuth, SAMLIdentityProvider
from social_core.exceptions import AuthForbidden
from openedx.core.djangoapps.theming.helpers import get_current_request
from third_party_auth.exceptions import IncorrectConfigurationException
This file has been truncated. show original
https://python-social-auth-docs.readthedocs.io/en/latest/backends/saml.html
andreask
(Andreas)
January 14, 2020, 2:10pm
2
Or do I have to write to the models with Django shell? Pro/cons? Anyone?
andreask
(Andreas)
January 16, 2020, 9:14am
3
Bump! Bump text so it’s 20 characters.
guruprasad
(Guruprasad Lakshmi Narayanan (OpenCraft) - opencraft.com/help)
January 27, 2020, 9:46am
4
@andreask , there are multiple such management commands in the platform which accept settings from the command line.
The create_or_update_site_configuration
command in the edx-platform
repository here accepts JSON data for the SiteConfiguration
values via the inline parameter or from a file.
The create_or_update_site
management command in the ecommerce
here defines flags/parameters for all expected configuration settings parameters.
1 Like