Connect WordPress and Microsoft Entra | Azure | 365

Update wp-config.php

In this step, you will add the parseable array of variables that you exported before, as a named constant to your WordPress website’s wp-config.php file.

To update your site’s wp-config.php, proceeds as follows.

  • Retrieve a copy of your site’s wp-config.php, for example with your favorite FTP client or open it in edit-mode with a file manager of your choice.
  • Locate the line that reads /* That’s all, stop editing! Happy publishing. */.
  • Add a new line to define the new named constant WPO_AAD_1 as follows.

Please note that as soon as you added the named constant to your site’s wp-config.php file, WPO365 will detect it and “read” its IdP configuration .


define('WPO_AAD_1', array (
    'app_only_application_id' => '',
    'app_only_application_secret' => '',
    'application_id' => 'e737dc1f-0949-4587-911a-------------',
    'application_secret' => 'ySh...',
    'default' => false,
    'id' => '65eed664caef6',
    'mail_application_id' => 'e737dc1f-0949-4587-911a-------------',
    'mail_application_secret' => 'ySh...',
    'mail_redirect_url' => 'https://www.wpo365connect.com/',
    'mail_tenant_id' => '9be34e84-6f85-4365-9a48-------------',
    'redirect_url' => 'https://www.wpo365connect.com/',
    'saml_base_url' => 'https://www.wpo365connect.com/',
    'saml_idp_entity_id' => '',
    'saml_idp_meta_data_url' => '',
    'saml_idp_sls_binding' => '',
    'saml_idp_sls_url' => '',
    'saml_idp_ssos_binding' => '',
    'saml_idp_ssos_url' => '',
    'saml_sp_acs_binding' => '',
    'saml_sp_acs_url' => '',
    'saml_sp_entity_id' => '',
    'saml_sp_sls_binding' => '',
    'saml_sp_sls_url' => '',
    'saml_x509_cert' => '',
    'tenant_id' => '9be34e84-6f85-4365-9a48-------------',
    'title' => 'Title for IdP 65eed664caef6',
    'type' => 'oidc',
));

The name of constant is by default WPO_AAD_1. The number (in this case “1”) refers to the blog ID of the current site. If you don’t run WordPress Multisite and if you haven’t configured BLOG_ID_CURRENT_SITE then the blog ID of the current site defaults to 1.


  • Continue by saving your changes and update your website’s wp-config.php by uploading the file – for example – using your favorite FTP client.
  • As a last step, you may want to obfuscate the Azure AD / IdP secrets by clicking the corresponding option on the plugin’s Single Sign-on page (or Mail configuration page when you’re using the WPO365 | MICROSOFT GRAPH MAILER instead of WPO365 | LOGIN plugin). This will replace the (secret) IdP values with placeholder values, as shown below.

Related Features