Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add how-to for extending registration form with dynamic fields #1238

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
41 changes: 41 additions & 0 deletions docs/how_tos/adding_custom_fields_to_the_registration.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
======================================================
Adding Custom Fields to the Registration Page in Authn
======================================================

Introduction
------------
This guide explains how to add custom fields to the registration page of your Open edX instance. To integrate custom fields with the new Authn MFE, additional configuration steps are required. Custom fields can be either required—added directly to the registration page—or optional, and will be added to a secondary registration page that users can skip.
KyryloKireiev marked this conversation as resolved.
Show resolved Hide resolved

Configuring Custom Registration Fields on the Back-End
------------------------------------------------------
To configure dynamic registration fields within Authn, perform the following steps in Open edX LMS settings or your custom form plugin:

#. **Install your custom form app and configure it in LMS**

Follow the steps outlined in the official Open edX documentation to configure custom registration fields for your instance:
`Customize the Registration Page <https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/customize_registration_page.html>`_.

#. **Enable Dynamic Registration Fields Setting in Open edX**

Enable the `ENABLE_DYNAMIC_REGISTRATION_FIELDS` setting in the settings file. This setting should be added in the plugin where the extension form is placed.

.. note:: See the context view for the Logistration page: `user_authn API Context View <https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/api/views.py#L61>`_.


#. **Add Fields to the Extended Profile Fields List**

Add your custom field to the `extended_profile_fields` list to ensure it is checked correctly during registration.

.. warning:: If this step is missed, fields from the extension form will not be added. For more information, please see the condition in: `helper.py <https://github.com/openedx/edx-platform/blob/master/openedx/core/djangoapps/user_authn/api/helper.py#L97>`_.
KyryloKireiev marked this conversation as resolved.
Show resolved Hide resolved


After adding all required settings, verify that the context has been properly extended with the new fields by inspecting the networks tab in your browser's developer tools.

Configuring Dynamic Registration Fields in Authn
------------------------------------------------

#. **Enable Dynamic Fields in the MFE**

Ensure that `ENABLE_DYNAMIC_REGISTRATION_FIELDS` is enabled for the MFE. This can be configured via env tokens or through site configurations if MFE CONFIG API is enabled.

Following these steps should help you integrate custom fields into the Authn MFE for Open edX.
Loading