From aa977f290492d6faed558c0bed1f5c6b240c304b Mon Sep 17 00:00:00 2001 From: Sanidhya Singh <47655001+ssingh13-rms@users.noreply.github.com> Date: Wed, 2 Apr 2025 13:10:57 +0100 Subject: [PATCH 1/2] Update azure_ad_config_guide.rst --- docs/azure_ad_config_guide.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/azure_ad_config_guide.rst b/docs/azure_ad_config_guide.rst index ca75127..701ee02 100644 --- a/docs/azure_ad_config_guide.rst +++ b/docs/azure_ad_config_guide.rst @@ -103,18 +103,21 @@ Replace your AUTH_ADFS with this. AUTH_ADFS = { - 'AUDIENCE': client_id, + 'AUDIENCE': [f'api://{client_id}', client_id], 'CLIENT_ID': client_id, 'CLIENT_SECRET': client_secret, - 'CLAIM_MAPPING': {'first_name': 'given_name', - 'last_name': 'family_name', - 'email': 'upn'}, + 'CLAIM_MAPPING': { + 'first_name': 'given_name', + 'last_name': 'family_name', + 'email': 'email' + }, 'GROUPS_CLAIM': 'roles', 'MIRROR_GROUPS': True, 'USERNAME_CLAIM': 'upn', 'TENANT_ID': tenant_id, - 'RELYING_PARTY_ID': client_id, + 'RELYING_PARTY_ID': client_id } + Add this to your AUTHENTICATION_BACKENDS. @@ -124,6 +127,7 @@ Add this to your AUTHENTICATION_BACKENDS. AUTHENTICATION_BACKENDS = [ ... 'django_auth_adfs.backend.AdfsAccessTokenBackend', + 'django_auth_adfs.backend.AdfsAuthCodeBackend' ... ] From 61af3a0eff8a980f491a3b7be024a20bd2d7970b Mon Sep 17 00:00:00 2001 From: Sanidhya Singh <47655001+ssingh13-rms@users.noreply.github.com> Date: Wed, 2 Apr 2025 13:14:52 +0100 Subject: [PATCH 2/2] Update azure_ad_config_guide.rst --- docs/azure_ad_config_guide.rst | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/azure_ad_config_guide.rst b/docs/azure_ad_config_guide.rst index 701ee02..46c3351 100644 --- a/docs/azure_ad_config_guide.rst +++ b/docs/azure_ad_config_guide.rst @@ -118,7 +118,19 @@ Replace your AUTH_ADFS with this. 'RELYING_PARTY_ID': client_id } - + + +Add this to your INSTALLED_APPS. + +.. code-block:: python + + INSTALLED_APPS = [ + ... + 'django_auth_adfs', + ... + ] + + Add this to your AUTHENTICATION_BACKENDS.