edx-oauth2-wordpress-backend/README.rst

77 lines
2.1 KiB
ReStructuredText
Raw Normal View History

2022-10-03 20:26:27 +03:00
OAuth2 Backend for WP Oauth
===========================
2022-10-03 19:46:35 +03:00
Overview
--------
2022-10-03 20:26:27 +03:00
A Python Social Auth backend for [WP OAuth](https://wp-oauth.com/), mostly used for Open edX but can be used elsewhere.
2022-10-03 19:46:35 +03:00
This package was originally cloned from https://github.com/appsembler/trinity-oauth-backend.
Setup
-----
General Python/Django
~~~~~~~~~~~~~~~~~~~~~
include this repo in your project's requiremets.txt, or install it from the command line.
2022-10-03 20:32:25 +03:00
.. code-block:: shell
2022-10-03 20:29:04 +03:00
2022-10-03 20:32:25 +03:00
cd path/to/your/project
source path/to/venv/bin/activate
pip install https://github.com/StepwiseMath/wp-oauth-backend
2022-10-03 19:46:35 +03:00
.. code-block:: yaml
2022-10-03 20:29:04 +03:00
2022-10-03 20:32:25 +03:00
ADDL_INSTALLED_APPS:
- "wp_oauth_backend"
THIRD_PARTY_AUTH_BACKENDS:
2022-10-03 20:42:04 +03:00
- "wp_oauth_backend.wp_oauth.WPOAuth2"
2022-10-03 20:32:25 +03:00
ENABLE_REQUIRE_THIRD_PARTY_AUTH: true
2022-10-03 19:46:35 +03:00
add these settings to django.conf:
.. list-table:: WP Oauth setup
:widths: 50 100
:header-rows: 1
* - Key
- Value
* - WPOAUTH_BACKEND_BASE_URL
- https://stepwisemath.ai
* - WPOAUTH_BACKEND_CLIENT_ID
- see: https://stepwisemath.ai/wp-admin/admin.php?page=wo_manage_clients
* - WPOAUTH_BACKEND_CLIENT_SECRET
- see: https://stepwisemath.ai/wp-admin/admin.php?page=wo_manage_clients
2022-10-03 20:26:27 +03:00
Cookiecutter openedx_devops build
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-10-03 20:31:43 +03:00
.. code-block:: shell
2022-10-03 20:26:27 +03:00
2022-10-03 20:31:43 +03:00
- name: Add the wp-oauth-backend
uses: openedx-actions/tutor-plugin-build-openedx-add-requirement@v1.0.0
with:
repository: wp-oauth-backend
repository-organization: StepwiseMath
repository-ref: main
repository-token: ${{ secrets.PAT }}
2022-10-03 20:26:27 +03:00
Cookiecutter openedx_devops deployment
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2022-10-03 20:31:43 +03:00
.. code-block:: shell
2022-10-03 20:26:27 +03:00
2022-10-03 20:31:43 +03:00
tutor config save --set OPENEDX_WPOAUTH_BACKEND_BASE_URL="${{ secrets.WPOAUTH_BACKEND_BASE_URL }}" \
--set OPENEDX_WPOAUTH_BACKEND_CLIENT_ID="${{ secrets.WPOAUTH_BACKEND_CLIENT_ID }}" \
--set OPENEDX_WPOAUTH_BACKEND_CLIENT_SECRET="${{ secrets.WPOAUTH_BACKEND_CLIENT_SECRET }}"
2022-10-03 19:46:35 +03:00
Developer Notes
2022-10-03 20:26:27 +03:00
-------------
This package is structured so that it can be uploaded to PyPI and installed using pip or easyinstall.
More detail here: https://python-packaging.readthedocs.io/en/latest/minimal.html