# Custom Registration Fields with Authn MFE How to?

**URL:** <https://discuss.openedx.org/t/custom-registration-fields-with-authn-mfe-how-to/14260>\
**Category:** Design\
**Tags:** how-to, tutor, olive\
**Created:** [October 29, 2024, 8:56am UTC](https://discuss.openedx.org/t/custom-registration-fields-with-authn-mfe-how-to/14260 "2024-10-29T08:56:30Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![choltha](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/choltha/32/7661_2.png) [@choltha](https://discuss.openedx.org/u/choltha)\
**Post date:** [October 29, 2024, 8:56am UTC](https://discuss.openedx.org/t/custom-registration-fields-with-authn-mfe-how-to/14260/1 "2024-10-29T08:56:30Z")

</div>

> [@Integrating Custom Registration Fields with Authn MFE](https://discuss.openedx.org/t/integrating-custom-registration-fields-with-authn-mfe/12574/3):
>
> Hey @harout7 To configure the new Authn MFE with custom fields from the registration extension form, additional configuration is required. If you have required fields, they will be added to the register page. However, if your fields are optional, they will be placed on an additional registration page that can be skipped. Firstly, you need to enable the ENABLE\_DYNAMIC\_REGISTRATION\_FIELDS setting from the settings file. This setting can be added from the plugin where the extension form is place…

I want to add fields with authn MFE  
I Create plugins

```auto
from tutor import hooks

hooks.Filters.ENV_PATCHES.add_item(
    (
        "openedx-lms-common-settings",
        "FEATURES['ENABLE_DYNAMIC_REGISTRATION_FIELDS'] = True"

        )
    

```

and activate

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/2/26f1833a1627ef9bb112db9a05a5806c3912d4e2.png)

If I want add fields gender ,year\_of\_birth, level\_of\_education to register page  
current register page

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/0/010f50c29343dffa3ae62dfb0d8b68acd79f5a1c.png)  
I don’t understand what to do next to make it work.

---

<div class="post-metadata">

**Author:** ![harout7](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/harout7/32/5369_2.png) [@harout7](https://discuss.openedx.org/u/harout7)\
**Post date:** [October 29, 2024, 12:56pm UTC](https://discuss.openedx.org/t/custom-registration-fields-with-authn-mfe-how-to/14260/2 "2024-10-29T12:56:21Z")

</div>

Hi @choltha

If you want to add fields from the available extra fields you can add them to a plguin like

```auto
REGISTRATION_EXTRA_FIELDS["gender"] = "required"

```

you can also check this reply

> [@How to add fields to the enrollment form](https://discuss.openedx.org/t/how-to-add-fields-to-the-enrollment-form/11992/2):
>
> Hi @campusedxud Welcome to Open edX! This topic is a little confusing, because we used to have the ability to add arbitrary fields to the registration form using a custom plugin app. However now, we can only enable a predefined list of optional fields: see [REGISTRATION\_EXTRA\_FIELDS](https://github.com/openedx/edx-platform/blob/open-release/quince.1/lms/envs/common.py#L3600-L3622) for details. If you want more fields than these, you’ll need to write some code. But to add the predefined extra fields to the registration form, you just need to change some settings used to run your Open edX appl…

---

<div class="post-metadata">

**Author:** ![choltha](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/choltha/32/7661_2.png) [@choltha](https://discuss.openedx.org/u/choltha)\
**Post date:** [October 29, 2024, 2:38pm UTC](https://discuss.openedx.org/t/custom-registration-fields-with-authn-mfe-how-to/14260/3 "2024-10-29T14:38:28Z")

</div>

Thank you for answering @harout7  
I clone [GitHub - pomegranited/tutor-contrib-enable-feature-flag: Demonstrates how to add a feature flag to Tutor](https://github.com/pomegranited/tutor-contrib-enable-feature-flag/) and add code  
[tutor-contrib-enable-feature-flag/tutorenable\_feature\_flag/plugin.py at main · pomegranited/tutor-contrib-enable-feature-flag · GitHub](https://github.com/pomegranited/tutor-contrib-enable-feature-flag/blob/main/tutorenable_feature_flag/plugin.py)

```auto
hooks.Filters.ENV_PATCHES.add_item(
            (
            "openedx-lms-common-settings",
            "FEATURES['ENABLE_DYNAMIC_REGISTRATION_FIELDS'] = True"
            "REGISTRATION_EXTRA_FIELDS['gender'] = required"

             )

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/a/ad3aea4a9be652eba8a198210fe7764ba13b206f.png)

save file and install plugin enable-feature-flag Am I correct?

---

<div class="post-metadata">

**Author:** ![choltha](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/choltha/32/7661_2.png) [@choltha](https://discuss.openedx.org/u/choltha)\
**Post date:** [October 30, 2024, 3:27am UTC](https://discuss.openedx.org/t/custom-registration-fields-with-authn-mfe-how-to/14260/4 "2024-10-30T03:27:29Z")

</div>

I add REGISTRATION\_EXTRA\_FIELDS[“gender”] = “required” to plugin but not working

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/5/5f3b9c2d3eb234a8a4c612a34007bcd8c34311ea.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/f/f828f34328c652ca589a64f5f25e637caddb7db0.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/6/6c4e93c08500925eff136f004608369aab0078cf.png)

---

<div class="post-metadata">

**Author:** ![harout7](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/harout7/32/5369_2.png) [@harout7](https://discuss.openedx.org/u/harout7)\
**Post date:** [November 1, 2024, 8:02am UTC](https://discuss.openedx.org/t/custom-registration-fields-with-authn-mfe-how-to/14260/5 "2024-11-01T08:02:37Z")

</div>

Hi @choltha

I have used YAML plugin to add additional fields in olive release (tutor, version 15.3.9) and it worked.

```auto
name: additionalfields
version: 0.1.0
patches:
  openedx-lms-common-settings: |
    REGISTRATION_EXTRA_FIELDS["gender"] = "required"

```

---

<div class="post-metadata">

**Author:** ![choltha](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.openedx.org/choltha/32/7661_2.png) [@choltha](https://discuss.openedx.org/u/choltha)\
**Post date:** [November 6, 2024, 8:35am UTC](https://discuss.openedx.org/t/custom-registration-fields-with-authn-mfe-how-to/14260/6 "2024-11-06T08:35:40Z")

</div>

Thank your @harout7  
I use plugin additionalfields.yml and enable

```auto
name: additionalfields
version: 0.1.0
patches:
  openedx-lms-common-settings: |
    REGISTRATION_EXTRA_FIELDS["gender"] = "required"

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/8/81eac0c69fd9538951d8153852a3415a725aa5e7.png)

not working  
show config

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/2/27aa68923532fe6a159e6f1b6b429db1dfd0c64c.png)

launch or tutor images build openedx?  
I user plugin

```auto
hooks.Filters.ENV_PATCHES.add_item(
    (
        "mfe-lms-production-settings",
        """
MFE_CONFIG["ENABLE_DYNAMIC_REGISTRATION_FIELDS"] = "true"

        """
    )
)

```

result register page from

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/0/050990b1203ba633509a4483091b8ce126ecf113.png)

To default fields (name, email, username, password).

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/3/38513432ebba54a35feb8a608d1ed9943e60a7c0.png)  
I can add Fields to this code?

```auto
hooks.Filters.ENV_PATCHES.add_item(
    (
        "mfe-lms-production-settings",
        """
MFE_CONFIG["ENABLE_DYNAMIC_REGISTRATION_FIELDS"] = "true"

        """
    )
)

```

after edit it working

```auto
hooks.Filters.ENV_PATCHES.add_item(
    (
        "mfe-lms-production-settings",
        """
ENABLE_DYNAMIC_REGISTRATION_FIELDS = "true"

MFE_CONFIG["ENABLE_DYNAMIC_REGISTRATION_FIELDS"] = "true"

REGISTRATION_EXTRA_FIELDS["gender"] = "required"

REGISTRATION_EXTRA_FIELDS["year_of_birth"] = "required"

EGISTRATION_EXTRA_FIELDS["city"] = "required"

EGISTRATION_EXTRA_FIELDS["state"] = "required"

REGISTRATION_EXTRA_FIELDS["country"] = "required"

REGISTRATION_EXTRA_FIELDS["title"] = "required"

REGISTRATION_EXTRA_FIELDS["terms_of_service"] = "required"

REGISTRATION_EXTRA_FIELDS["level_of_education"] = "required"

REGISTRATION_EXTRA_FIELDS["mailing_address"] = "required"

REGISTRATION_EXTRA_FIELDS["specialty"] = "required"

        """
    )
)

```

 ![image](https://us1.discourse-cdn.com/flex020/uploads/openedx/original/2X/f/fd279e0f4bbd7dd86651ad994ccc90dffbd6fb88.png)  
But I selected the country field but it didn’t work.
