- Issue created by @Ruuds
- 🇨🇦Canada mparker17 UTC-4
I have code-reviewed and manually tested the code in merge request !34, and I'm satisfied with it.
Here is what I did to manually-test !34:
- Install ddev (I tested on version 1.24.1)
- Clone the module, issue fork, and branch:
git clone --branch '2.0.x' https://git.drupalcode.org/project/openid_connect_windows_aad.git && cd openid_connect_windows_aad
- clone the projectgit remote add openid_connect_windows_aad-3485376 https://git.drupalcode.org/issue/openid_connect_windows_aad-3485376.git && git fetch openid_connect_windows_aad-3485376
- add a remote for the issue forkgit checkout -b '3485376-drupal-11-support' --track openid_connect_windows_aad-3485376/'3485376-drupal-11-support'
- switch to the branch for merge request !34
- Set up a test site for the module with the ddev/ddev-drupal-contrib plugin:
ddev config --project-type=drupal --docroot=web --php-version=8.3 --corepack-enable --project-name=openid-connect-windows-aad
ddev add-on get ddev/ddev-drupal-contrib && ddev start && ddev poser && ddev symlink-project
- run the setup steps for the ddev/ddev-drupal-contrib addon- Patch openid_connect with
#3486049-6: 'Settings' option not accessible →
to fix a bug unrelated to this module:
cd web/modules/contrib/openid_connect && curl -OL https://www.drupal.org/files/issues/2024-11-11/openid_connect-3486049-6.patch && patch -p1 < openid_connect-3486049-6.patch && cd -
- Go to
https://openid-connect-windows-aad.ddev.site/core/install.php
in a browser. Confirm that I saw the Drupal 11.0.9 installer. Install the site with the "Standard" install profile
- Set up the module for testing:
- Go to
/admin/modules
and enable theopenid_connect_windows_aad
module and its dependencies - Go to
/admin/config/people/openid-connect/settings
and set the following options: (if you get an error when visiting this URL, don't forget to patch openid_connect with #3486049-6: 'Settings' option not accessible → to fix the bug in that module)- Save user claims on every login = (checked)
- Override registration settings = (checked)
- OpenID buttons display in user login form =
Above
- Advanced -> Automatically connect existing users = (checked) (warning: you probably don't want to use this setting on a real site, but it's good enough to test openid_connect_windows_aad's basic functionality in D11)
... then click Save configuration.
- Go to
/admin/config/people/accounts
, and set Who can register accounts? toVisitors
, then click Save configuration. (warning: you probably don't want to use this setting on a real site, but it's good enough to test openid_connect_windows_aad's basic functionality in D11) -
Set up a Microsoft Entra ID app configuration as described in this module's documentation →
, i.e.:
- Go to
https://portal.azure.com
and log in if needed. Go to the hamburger menu -> All services. Under Identity, click Microsoft Entra ID - Go to Add -> App registration:
- Name =
openid-connect-windows-aad-drupal11-test
- Supported account types = (whatever makes sense for your use case)
- Redirect URI:
- Select a platform =
Web
- Redirect URI =
https://openid-connect-windows-aad.ddev.site/openid-connect/azure_oidc_d11_test
- Select a platform =
... then click Register.
- Name =
- Go to
https://portal.azure.com
again. Go to the hamburger menu -> All services. Under Identity, click Microsoft Entra ID - In the Microsoft Entra ID sidebar, go to Manage -> App registrations and click openid-connect-windows-aad-drupal11-test
- In the openid-connect-windows-aad-drupal11-test app's sidebar, go to Manage -> Certificates & secrets. In the main area of the page, under Client secrets, click New client secret. Set Description =
testd11
and Expires =90 days (3 months)
. Click Add. Copy the Value. - In Drupal, go to
/admin/config/system/keys/add
, enter:- Key name =
oidc_entra_app_key
- Key type =
Encryption
- Key size =
Other
- Custom key size =
320
- Key provider =
Configuration
- [Key] Base64-encoded = TRUE
- Key value = (paste the client secret you created in the previous step)
- [Value] Base64-encoded = FALSE
... click Save. You see the message The key oidc_entra_app_key has been added.
- Key name =
- In the Azure Portal, in the openid-connect-windows-aad-drupal11-test app's sidebar, click Overview. Under Essentials, copy the Application (client) ID.
- In Drupal, go to
/admin/config/people/openid-connect/add/windows_aad
. You see a Add OpenID Connect client form. Enter:- Name =
azure_oidc_d11_test
- Client ID = (paste the client ID you copied in the previous step)
... don't submit the form yet...
- Name =
- In the Azure Portal, still on the openid-connect-windows-aad-drupal11-test app's Overview page, click Endpoints at the top. An Endpoints sidebar opens:
- Copy OAuth 2.0 authorization endpoint (v2) to a temporary file
- Copy OAuth 2.0 token endpoint (v2) to a temporary file
- In Drupal, on the Add OpenID Connect client form:
- Allowed domains = (the scheme and authority part of the OAuth 2.0 authorization endpoint (v2), e.g.:
https://login.microsoftonline.com
- Authorization endpoint = (paste the OAuth 2.0 authorization endpoint (v2) you copied in the previous step)
- Token endpoint = (paste the OAuth 2.0 token endpoint (v2) you copied in the previous step)
- End session endpoint = (leave blank)
- Map user's AD groups to Drupal roles = (unchecked)
- User info endpoint configuration =
Alternate or no user endpoint
- Alternate UserInfo endpoint = (leave blank)
- Use Graph API otherMails property for email address = (unchecked)
- Update email address in user profile = (unchecked)
- Hide missing email address warning = (unchecked)
- Subject key =
sub
- Check that the Redirect URL matches the Redirect URI you entered when setting up the Entra ID App (e.g.:
https://openid-connect-windows-aad.ddev.site/openid-connect/azure_oidc_d11_test
)
... click Create OpenID Connect client. You see the message OpenID Connect client azure_oidc_d11_test has been added.
- Allowed domains = (the scheme and authority part of the OAuth 2.0 authorization endpoint (v2), e.g.:
- Go to
- In Drupal, Go to
/admin/config/development/performance
click Clear all caches
- Go to
- Test the basic module functions in Drupal 11:
- Log out from the administrator account.
- Go to
/user/login
. You should see a Log in with azure_oidc_d11_test button above the Username and Password fields. - Click the Log in with azure_oidc_d11_test button and authenticate with your Microsoft credentials. You are logged in.
- Make sure there are no errors being logged:
- Log out of the
test_editor
user created earlier; and log in as the administrator again - Go to
/admin/reports/dblog
to ensure our setup/testing did not result in any error messages related to this module.
- Log out of the
- First commit to issue fork.
-
fabianderijk →
committed 893e5143 on 2.0.x authored by
ruuds →
Issue #3485376 by ruuds, mparker17: Drupal 11 support
-
fabianderijk →
committed 893e5143 on 2.0.x authored by
ruuds →
- Status changed to Fixed
4 months ago 1:51pm 3 January 2025 - 🇳🇱Netherlands fabianderijk Alphen aan den Rijn
This is now merged in the dev branch. Thanks for the work.
- 🇦🇺Australia dpi Perth, Australia
Could we get a new @beta release including this one <3
Automatically closed - issue fixed for 2 weeks with no activity.