diff --git a/README.rst b/README.rst index 951a7c3..ce378dc 100644 --- a/README.rst +++ b/README.rst @@ -17,6 +17,24 @@ working on your Open edX installation. Usage ----- +An example implementation for an Open edX installation named https://web.stepwisemath.ai + +1. add this package to your project's requiremets +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +include this repo in your project's requiremets.txt, or install it from the command line. + +.. code-block:: shell + + cd path/to/your/virtual/environment + source path/to/venv/bin/activate + pip install https://github.com/lpm0073/wp-oauth-backend + +2. subclass WPOpenEdxOAuth2 +~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Subclass wp_oauth_backend.wp_oauth.WPOpenEdxOAuth2, and configure for your Wordpress oauth provider. + .. code-block:: python from wp_oauth_backend.wp_oauth import WPOpenEdxOAuth2 @@ -37,29 +55,8 @@ Usage # might clean this up for you, but i'm not 100% certain of that. BASE_URL = "https://stepwisemath.ai" - -Open edX Setup --------------- - -.. image:: doc/django-admin-1.png - :width: 100% - :alt: Open edX Django Admin Add Provider Configuration (OAuth) - -.. image:: doc/django-admin-2.png - :width: 100% - :alt: Open edX Django Admin Add Provider Configuration (OAuth) - - -General Python/Django -~~~~~~~~~~~~~~~~~~~~~ - -include this repo in your project's requiremets.txt, or install it from the command line. - -.. code-block:: shell - - cd path/to/your/project - source path/to/venv/bin/activate - pip install https://github.com/StepwiseMath/wp-oauth-backend +3. configure your Open edX lms application +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code-block:: yaml @@ -90,6 +87,17 @@ add these settings to django.conf: * - REDIRECT_URI - https://web.stepwisemath.ai/auth/complete/stepwisemath-oauth +4. Configure a new Oauth2 client from the lms Django Admin console +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. image:: doc/django-admin-1.png + :width: 100% + :alt: Open edX Django Admin Add Provider Configuration (OAuth) + +.. image:: doc/django-admin-2.png + :width: 100% + :alt: Open edX Django Admin Add Provider Configuration (OAuth) + Cookiecutter openedx_devops build ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/wp_oauth_backend/stepwise_oauth.py b/wp_oauth_backend/stepwise_oauth.py deleted file mode 100644 index 5a9c921..0000000 --- a/wp_oauth_backend/stepwise_oauth.py +++ /dev/null @@ -1,17 +0,0 @@ -from .wp_oauth import WPOpenEdxOAuth2 - - -class StepwiseMathWPOAuth2(WPOpenEdxOAuth2): - - # This defines the backend name and identifies it during the auth process. - # The name is used in the URLs /login/ and /complete/. - # - # This is the string value that will appear in the LMS Django Admin - # Third Party Authentication / Provider Configuration (OAuth) - # setup page drop-down box titled, "Backend name:", just above - # the "Client ID:" and "Client Secret:" fields. - name = "stepwisemath-oauth" - - # note: no slash at the end of the base url. Python Social Auth - # might clean this up for you, but i'm not 100% certain of that. - BASE_URL = "https://stepwisemath.ai"