Microsoft oauth2 single tenant

Hi all:

By default, if I’m not wrong, PHPMaker 2026 uses https://login.microsoftonline.com/common/oauth2/authorize for logging with Microsoft, It’s valid for a Multi-tenant app. If you want to use this just to auth with your organization users, you should change in src/config.php, the word “common” for your tenant dir id.

// Authentication configuration for Google/Facebook/Microsoft, etc.
'HWI_OAUTH' => [
  'resource_owners' => [
     'microsoft' => [
       'type' => 'azure', // HWIOAuthBundle uses 'azure'
       'client_id' => 'fake-3ef6-4451-977e-fad982342',
       'client_secret' => 'fake~8~fadafefwefw~5rG9i1CiT.42ydqj',
       'scope' => 'openid profile email offline_access',
       'options' => [
           'application' => 'common', // Change this
       ],
    ],
  ],
],

You may set in Global Code:

Config('HWI_OAUTH.resource_owners.microsoft.options.application', 'xxx');
1 Like