• Resolved yalet

    (@yalet)


    We’re testing this plugin to evaluate whether it meets our needs. One thing I noticed is that in the context of a multi-site subdomain install, you would need to configure your CAS server with each subdomain as a service in the service whitelist. Would you consider adding an option for a network-activated configuration option for sending the base url of a multisite subdomain install for every login request with a parameter to redirect back to the site that was originally requested?

    https://www.ads-software.com/plugins/wp-cassify/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi,
    I’ve not tested the plugin with multisite subdomain configuration, but only with multisite subdirectories configuration.
    I take note of your problem and i try to answer you at the end of week.

    Best regards.

    Hi,

    Yes it works with multisite subdomain install (version 1.8.6). I’ve installed multisite with subdomain install :

    I’ve activated WP Cassify over the network (not by each blog).

    My cas server is cas.dev.lan. I’ve edited a file wildcard.wp.test.json a in webapps/cas/WEB-INF/classes/services like below (Adapt allowedAttributes with your config) :

    {
      "@class" : "org.jasig.cas.services.RegexRegisteredService",
      "serviceId" : "^(http|https)://.*\\.wp\\.test/.*",
      "name" : "wp.test domain",
      "id" : 101,
      "description" : "Access to domain wp.test",
      "attributeReleasePolicy" : {
        "@class" : "org.jasig.cas.services.ReturnAllowedAttributeReleasePolicy",
        "allowedAttributes" : [ "java.util.ArrayList", [ "first_name", "last_name", "email", "company", "website", "country", "title" ] ]
      }
    }

    Then i try to access to https://blog1.wp.test/wp-admin/ then i’ve been correctly redirected like below :

    https://cas.dev.lan/cas/login?service=https://blog1.wp.test/wp-admin/

    The service callback url is set according to blog url.

    Keep me informed, if it answers your question.

    Best regards.

    Thread Starter yalet

    (@yalet)

    Hmm, the problem is that the only regexes that match all of our subdomains on WordPress would also match everything in our entire domain or be functionally equivalent to having several hundred service entries, so that’s not going to work for us.

    What I’m really looking for is a way for the plugin to make the service parameter

    https://<DOMAIN_CURRENT_SITE&gt;?site=<SITE_REQUESTED_LOGIN>

    and then when they return from CAS, after validating the ticket they get redirected to <SITE_REQUESTED_LOGIN>, which is where they wanted to go.

    Hi,

    Json service configuration file does not concern plugin but CAS server configuration. So you can make as you want. (With regex or one file per subdomain).

    You want a way to override service parameter with your own value. I give you a workaround.
    First, you can defined a custom filter.

    Put the code below in classes/wp_cassify_plugin.php in wp_cassify_redirect function like this (add lines before $redirect_url) :

    // Define custom plugin filter to build service url with your own value.
    					if( has_filter( 'wp_cassify_redirect_service_url_filter' ) ) {
    						$service_url = apply_filters( 'wp_cassify_redirect_service_url_filter', $service_url );
    					}
    
    					$redirect_url = $wp_cassify_base_url .
    						$wp_cassify_login_servlet . '?' .
    						$this->wp_cassify_default_service_service_parameter_name . '=' . $service_url;

    Then in your functions.php, you can call the filter and make as you want with $service_url variable, for example :

    // Force service url
    function custom_action_wp_cassify_redirect_service_url_filter( $service_url ) {
        // Here you can build service url with you own value.
        $service_url = "https://www.dev.lan/sandbox01/2016/02/09/hello-world/";
    
        return $service_url;
    }
    
    add_filter( 'wp_cassify_redirect_service_url_filter', 'custom_action_wp_cassify_redirect_service_url_filter', 1, 1 );

    Best regards.

    Hi,

    I’ve understood what do you want. So in 1.8.8, i’ve added an option wp_cassify_override_service_url. This option allow to rewrite service url as you like : https://<DOMAIN_CURRENT_SITE&gt;?site=<SITE_REQUESTED_LOGIN>

    https://www.dev.lan/?wp_cassify_redirect_to={WP_CASSIFY_CURRENT_SERVICE_URL}

    {WP_CASSIFY_CURRENT_SERVICE_URL} is replaced on the fly by site requested login.

    This allow you to define only one json file with to grant only root domain.

    Here is the documentation the full documentation to use this option :
    https://wpcassify.wordpress.com/wp-cassify-plugin-documentation/

    Best regards.

    Thread Starter yalet

    (@yalet)

    Thanks, I was able to use the filter and an init action to get the behavior I wanted.

    I appreciate the quick turnaround.

    Ok,
    So i close ticket.

    Best regards.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Subdomain sites and service registries’ is closed to new replies.