Skip to content

Commit

Permalink
feat: improve the way we handle the IES IDP id values.
Browse files Browse the repository at this point in the history
  • Loading branch information
Squirrel18 committed Jul 29, 2024
1 parent cde1ca8 commit 975f8f9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
8 changes: 1 addition & 7 deletions common/djangoapps/third_party_auth/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -964,13 +964,7 @@ def user_details_force_sync(auth_entry, strategy, details, user=None, *args, **k
setattr(model, field, provider_value)

# Generate fullname only for IES IDP.
# We deliberately left these values hard-coded instead of using Django settings because
# it would force us to add custom settings to the edx platform code,
# which we try to avoid as we might lose track of that kind of setting.
ies_entity_ids = [
'https://iam-stage.pearson.com:443/auth/saml-idp-uid',
'https://iam.pearson.com:443/auth/saml-idp-uid',
]
ies_entity_ids = getattr(settings, 'SAML_IES_ENTITIES_IDS', [])
first_name = details.get('first_name')
last_name = details.get('last_name')

Expand Down
14 changes: 14 additions & 0 deletions lms/envs/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -5312,3 +5312,17 @@ def _should_send_learning_badge_events(settings):
"learning-badges-lifecycle",
"enabled",
)

# IES SAML integration.
# .. setting_name: SAML_IES_ENTITIES_IDS
# .. setting_default: []
# .. setting_example_value: ['https://my-idp-integration-uri-id']
# .. setting_description: This configuration allows us to define the IDs of the IES entities, to perform certain actions to the SAML IES request only.
# adding a new step to SOCIAL_AUTH_PIPELINE (edx-platform/common/djangoapps/third_party_auth/settings.py)
# is not a feasible option, since we can't override the SOCIAL_AUTH_PIPELINE from the Django or other plugin configuration,
# so we decided to handle it this way and add the necessary logic, directly in the edx-platform code
# edx-platform/common/djangoapps/third_party_auth/pipeline.py
# We will define the requried values using our Tutor plugin.
# Entity ID docs:
# https://edx.readthedocs.io/projects/edx-installing-configuring-and-running/en/latest/configuration/tpa/tpa_integrate_open/tpa_SAML_IdP.html#add-and-enable-a-saml-identity-provider
SAML_IES_ENTITIES_IDS = []

0 comments on commit 975f8f9

Please sign in to comment.