WP-Config.php | Multiple Identity Providers (IdPs)

Update wp-config.php

Steps in this Topic

In this step, you will add the parseable arrays 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.

Enable your WordPress website to support multiple Identity Providers
  • 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_IDPS_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 use it to “read” the IdPs configuration .


/* That's all, stop editing! Happy publishing. */

define(
    'WPO_IDPS_1',
    array(
        array(
            'app_only_application_id' => '',
            'app_only_application_secret' => '',
            'application_id' => 'e737dc1f-0949-4587-------------',
            'application_secret' => 'ySh...',
            'default' => true,
            'domains' => array('domain-a.com', 'domain-a.onmicrosoft.com'),
            'id' => '65eed664caef6',
            'mail_application_id' => 'e737dc1f-0949-4587-------------',
            'mail_application_secret' => 'ySh...',
            'mail_redirect_url' => 'https://[...]/',
            'mail_tenant_id' => '9be34e84-6f85-4365-9a48-------------',
            'redirect_url' => 'https://[...]/',
            'saml_base_url' => 'https://[...]/',
            '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' => 'Sign in with domain A',
            'type' => 'oidc',
        ),
        array(
            'app_only_application_id' => '',
            'app_only_application_secret' => '',
            'application_id' => 'f0861adc-702b-4433-------------',
            'application_secret' => '8Q~...',
            'default' => false,
            'domains' => array('domain-b.com',),
            'id' => '62aad664caeg8',
            'mail_application_id' => '',
            'mail_application_secret' => '',
            'mail_redirect_url' => 'https://[...]/',
            'mail_tenant_id' => '',
            'redirect_url' => 'https://[...]/',
            'saml_base_url' => 'https://[...]/',
            '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' => 'Sign in with domain B',
            'type' => 'oidc',
        )
    ),

);

The name of constant is by default WPO_IDPS_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.

120+

5 Star Reviews

20K+

Installations

400K+

Downloads