pantheon-systems / wp-saml-auth

Rock-solid SAML authentication for WordPress built on a modern foundation.
https://wordpress.org/plugins/wp-saml-auth/
89 stars 43 forks source link

Run test suite against multisite #16

Open danielbachhuber opened 8 years ago

danielbachhuber commented 8 years ago

Because we're creating new users, we should make sure this plugin works as expected on multisite.

audiovisuel-uqam commented 6 years ago

Are plans for multisite feature still in the works?

danielbachhuber commented 6 years ago

@audiovisuel-uqam Nothing specific on our radar at the moment. This issue is predominately for test coverage. Is there a specific need you're trying to solve?

audiovisuel-uqam commented 6 years ago

My bad, tested again and it works on multisite in our typical environment, for some reason it isn't working in an nginx setup we are testing.

jithujoseph commented 1 year ago

For me, on a multisite, we are always getting redirected back to the root site's dashboard rather than the requested site dashboard. We are using Simplesamlphp instead of OneLogin. The multisite is a sub-domain setup and not a sub-directory approach. Not sure if there's a fix for this...

nicholsonjf commented 8 months ago

For me, on a multisite, we are always getting redirected back to the root site's dashboard rather than the requested site dashboard. We are using Simplesamlphp instead of OneLogin. The multisite is a sub-domain setup and not a sub-directory approach. Not sure if there's a fix for this...

We have subdomain and subdirectory sites in our network. We solved this by adding a check in our wp-saml-auth config file that checks if the current request contains the network_home_url(). We're using the OneLogin backend, so it may work differently if you're using SimpleSAML.

$is_main_domain = str_contains( home_url(), network_home_url() );
// sub-section of our config array
            'sp'           => array(
                'entityId' => $is_main_domain ? $network_home_url . '/' : home_url() . '/',
                'assertionConsumerService' => array(
                    'url'  => $is_main_domain ? $network_home_url . '/wp-login.php' : wp_login_url(),
                    'binding' => 'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST',
                ),
            )