Skip to content

Commit

Permalink
🗑️ [#3283] Deprecate legacy OIDC callback endpoints
Browse files Browse the repository at this point in the history
With Open Forms 3.0, we can make the breaking change of updating the
default.

The new OIDC API endpoints all point to a single callback URL, so it
means less configuration overhead on the identity provider side. The
breaking change means that the new URI's must be added to the
allowlist of the identity provider.

The new endpoint is '/auth/oidc/callback/', and it applies to all
OIDC configuration flavours.
  • Loading branch information
sergei-maertens committed Dec 19, 2024
1 parent f8095b4 commit 64f6152
Show file tree
Hide file tree
Showing 60 changed files with 1,374 additions and 1,379 deletions.
7 changes: 2 additions & 5 deletions docs/configuration/authentication/oidc_digid.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,9 @@ omgeving van de OpenID Connect provider.

**Redirect URI (vanaf Open Formulieren 2.7.0)**

.. warning::
.. versionchanged:: 3.0

Zorg dat Open Formulieren :ref:`geïnstalleerd <installation_index>` is met de
``USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS=false``
:ref:`omgevingsvariabele<installation_environment_config>`, anders worden de legacy
(zie hieronder) endpoints gebruikt.
Open Forms no longer uses the legacy endpoints by default.

Voor de **Redirect URI** vul je ``https://open-formulieren.gemeente.nl/auth/oidc/callback/`` in,
waarbij je ``open-formulieren.gemeente.nl`` vervangt door het relevante domein.
Expand Down
7 changes: 2 additions & 5 deletions docs/configuration/authentication/oidc_eherkenning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,9 @@ maken in de omgeving van de OpenID Connect provider.

**Redirect URI (vanaf Open Formulieren 2.7.0)**

.. warning::
.. versionchanged:: 3.0

Zorg dat Open Formulieren :ref:`geïnstalleerd <installation_index>` is met de
``USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS=false``
:ref:`omgevingsvariabele<installation_environment_config>`, anders worden de legacy
(zie hieronder) endpoints gebruikt.
Open Forms no longer uses the legacy endpoints by default.

Voor de **Redirect URI** vul je ``https://open-formulieren.gemeente.nl/auth/oidc/callback/`` in,
waarbij je ``open-formulieren.gemeente.nl`` vervangt door het relevante domein.
Expand Down
7 changes: 2 additions & 5 deletions docs/configuration/general/oidc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ maken in de omgeving van de OpenID Connect provider.

**Redirect URI (vanaf Open Formulieren 2.7.0)**

.. warning::
.. versionchanged:: 3.0

Zorg dat Open Formulieren :ref:`geïnstalleerd <installation_index>` is met de
``USE_LEGACY_OIDC_ENDPOINTS=false`` en ``USE_LEGACY_ORG_OIDC_ENDPOINTS=false``
:ref:`omgevingsvariabelen<installation_environment_config>`, anders worden de legacy
(zie hieronder) endpoints gebruikt.
Open Forms no longer uses the legacy endpoints by default.

Voor de **Redirect URI** vul je ``https://open-formulieren.gemeente.nl/auth/oidc/callback/`` in,
waarbij je ``open-formulieren.gemeente.nl`` vervangt door het relevante domein. Deze
Expand Down
17 changes: 0 additions & 17 deletions docs/installation/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -277,23 +277,6 @@ Other settings
enable :ref:`Organization accounts <configuration_authentication_oidc>`. Defaults
to ``False``.

* ``USE_LEGACY_OIDC_ENDPOINTS``: Defaults to ``True`` for backwards compatibility
reasons. New installations should opt-out. If ``False``, the OIDC callback URL is
``/auth/oidc/callback/``, if ``True``, it is ``/oidc/callback/``.

* ``USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS``: Defaults to ``True`` for backwards compatibility
reasons. New installations should opt-out. If ``False``, the OIDC callback URL is
``/auth/oidc/callback/``, if ``True``, they are:

- ``/digid-oidc/callback/``
- ``/eherkenning-oidc/callback/``
- ``/digid-machtigen-oidc/callback/``
- ``/eherkenning-bewindvoering-oidc/callback/``

* ``USE_LEGACY_ORG_OIDC_ENDPOINTS``: Defaults to ``True`` for backwards compatibility
reasons. New installations should opt-out. If ``False``, the OIDC callback URL is
``/auth/oidc/callback/``, if ``True``, it is ``/org-oidc/callback/``.

* ``SESSION_EXPIRE_AT_BROWSER_CLOSE``: Controls if sessions expire at browser close.
This applies to both the session of end-users filling out forms and staff using the
administrative interface. Enabling this forces users to log in every time they open
Expand Down
23 changes: 23 additions & 0 deletions docs/installation/upgrade-300.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,29 @@ be aware of, as they may require additional manual actions.
:depth: 1
:local:

Legacy OpenID Connect callback endpoints are now disabled by default
====================================================================

Before Open Forms 3.0, the legacy endpoints were used by default.

The following environment variables now default to ``False`` instead of ``True``:

* ``USE_LEGACY_OIDC_ENDPOINTS``
* ``USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS``
* ``USE_LEGACY_ORG_OIDC_ENDPOINTS``

To keep the old behaviour, make sure you deploy with:

.. code-block:: bash
USE_LEGACY_OIDC_ENDPOINTS=True
USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS=True
USE_LEGACY_ORG_OIDC_ENDPOINTS=True
To use the new behaviour, you must ensure that
``https://open-formulieren.gemeente.nl/auth/oidc/callback/`` is listed in the allowed
**Redirect URI** values of your identity provider.

Removal of price logic
======================

Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/openforms/accounts/tests/test_oidc.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_oidc_button_enabled(self):
)


class OIDCFLowTests(OFVCRMixin, WebTest):
class OIDCFlowTests(OFVCRMixin, WebTest):
VCR_TEST_FILES = TEST_FILES

@mock_admin_oidc_config()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Meta:
def oidc_authentication_callback_url(cls) -> str: # type: ignore
if settings.USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS:
warnings.warn(
"Legacy DigiD-eHerkenning callback endpoints will be removed in 3.0",
"Legacy DigiD-eHerkenning callback endpoints will be removed in 4.0",
DeprecationWarning,
)
return "digid_oidc:callback"
Expand All @@ -51,7 +51,7 @@ class Meta:
def oidc_authentication_callback_url(cls) -> str: # type: ignore
if settings.USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS:
warnings.warn(
"Legacy DigiD-eHerkenning callback endpoints will be removed in 3.0",
"Legacy DigiD-eHerkenning callback endpoints will be removed in 4.0",
DeprecationWarning,
)
return "digid_machtigen_oidc:callback"
Expand All @@ -71,7 +71,7 @@ class Meta:
def oidc_authentication_callback_url(cls) -> str: # type: ignore
if settings.USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS:
warnings.warn(
"Legacy DigiD-eHerkenning callback endpoints will be removed in 3.0",
"Legacy DigiD-eHerkenning callback endpoints will be removed in 4.0",
DeprecationWarning,
)
return "eherkenning_oidc:callback"
Expand All @@ -91,7 +91,7 @@ class Meta:
def oidc_authentication_callback_url(cls) -> str: # type: ignore
if settings.USE_LEGACY_DIGID_EH_OIDC_ENDPOINTS:
warnings.warn(
"Legacy DigiD-eHerkenning callback endpoints will be removed in 3.0",
"Legacy DigiD-eHerkenning callback endpoints will be removed in 4.0",
DeprecationWarning,
)
return "eherkenning_bewindvoering_oidc:callback"
Expand Down
Loading

0 comments on commit 64f6152

Please sign in to comment.