Make this module support Drupal 11.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

ruuds created an issue. See original summary.

jeroent’s picture

Status: Active » Needs review
mparker17’s picture

Status: Needs review » Reviewed & tested by the community

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:

  1. Install ddev (I tested on version 1.24.1)
  2. Clone the module, issue fork, and branch:
    1. git clone --branch '2.0.x' https://git.drupalcode.org/project/openid_connect_windows_aad.git && cd openid_connect_windows_aad - clone the project
    2. git 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 fork
    3. git checkout -b '3485376-drupal-11-support' --track openid_connect_windows_aad-3485376/'3485376-drupal-11-support' - switch to the branch for merge request !34
  3. Set up a test site for the module with the ddev/ddev-drupal-contrib plugin:
    1. ddev config --project-type=drupal --docroot=web --php-version=8.3 --corepack-enable --project-name=openid-connect-windows-aad
    2. 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
    3. 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 -
    4. 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
  4. Set up the module for testing:
    1. Go to /admin/modules and enable the openid_connect_windows_aad module and its dependencies
    2. 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)
      1. Save user claims on every login = (checked)
      2. Override registration settings = (checked)
      3. OpenID buttons display in user login form = Above
      4. 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.

    3. Go to /admin/config/people/accounts, and set Who can register accounts? to Visitors, 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)
    4. Set up a Microsoft Entra ID app configuration as described in this module's documentation, i.e.:
      1. Go to https://portal.azure.com and log in if needed. Go to the hamburger menu -> All services. Under Identity, click Microsoft Entra ID
      2. 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

        ... then click Register.

      3. Go to https://portal.azure.com again. Go to the hamburger menu -> All services. Under Identity, click Microsoft Entra ID
      4. In the Microsoft Entra ID sidebar, go to Manage -> App registrations and click openid-connect-windows-aad-drupal11-test
      5. 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.
      6. 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.

      7. In the Azure Portal, in the openid-connect-windows-aad-drupal11-test app's sidebar, click Overview. Under Essentials, copy the Application (client) ID.
      8. 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...

      9. 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
      10. 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.

    5. In Drupal, Go to /admin/config/development/performance click Clear all caches
  5. Test the basic module functions in Drupal 11:
    1. Log out from the administrator account.
    2. Go to /user/login. You should see a Log in with azure_oidc_d11_test button above the Username and Password fields.
    3. Click the Log in with azure_oidc_d11_test button and authenticate with your Microsoft credentials. You are logged in.
  6. Make sure there are no errors being logged:
    1. Log out of the test_editor user created earlier; and log in as the administrator again
    2. Go to /admin/reports/dblog to ensure our setup/testing did not result in any error messages related to this module.

fabianderijk made their first commit to this issue’s fork.

fabianderijk’s picture

Status: Reviewed & tested by the community » Fixed

This is now merged in the dev branch. Thanks for the work.

dpi’s picture

Could we get a new @beta release including this one <3

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.