Alain-Aymerick FRANCOIS
Forum Replies Created
-
Yes but here you must consider that we are not in classic WordPress usage.
For example with CAS Authentication with automatic user creation, when user is authenticated from an trusted external source, user must have minimum rights to use blog (this behavior is like CAS Maestro or another WordPress CAS plugin).
And when CAS server v2 is used, no cas user attribute can be used to discriminate user and map subscriber role or another role. So there is no interest to use this plugin if user has not minimal capacities to use blog.
If you have private blogs (event if user is CAS authenticated) and public blogs, you can enable WP Cassify, blog by blog (no network activation) and only on public blogs. So private blogs can’t be accessed.
At the end, if you’re not satisfied, you can easily bypass this behavior and modify parts of plugin code.
Hi,
It’s not a bug. If user is successfully authenticated, subscriber role is pushed at least. This is the same behavior when plugin is enable site by site. You can use Authorization Rule Editor with order Deny/Allow to filter access.
Best regards.
Forum: Plugins
In reply to: [WP Cassify] Bypass CAS authentificationHi,
You’re right. There is a bug on bypass. Please update to 1.8.9.
Best regards.
Forum: Plugins
In reply to: [WP Cassify] Bypass mechanism doesn't work for logoutHi,
You’re right. I’ve made changes. Please update to 1.8.9.
Best regards.
Forum: Plugins
In reply to: [WP Cassify] Subdomain sites and service registriesOk,
So i close ticket.Best regards.
Forum: Plugins
In reply to: [WP Cassify] Subdomain sites and service registriesHi,
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>?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.
Forum: Plugins
In reply to: [WP Cassify] Subdomain sites and service registriesHi,
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 = "http://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.
Forum: Plugins
In reply to: [WP Cassify] Subdomain sites and service registriesHi,
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 http://blog1.wp.test/wp-admin/ then i’ve been correctly redirected like below :
https://cas.dev.lan/cas/login?service=http://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.
Forum: Plugins
In reply to: [WP Cassify] Bypass CAS authentificationHi,
To create an authentication form to perform a local wordpress authentication bypassing CAS auth, you can use this code below in a template :
<?php $args = array( 'echo' => true, 'remember' => true, 'redirect' => site_url( '/?wp_cassify_bypass=bypass' ), 'form_id' => 'loginform', 'id_username' => 'user_login', 'id_password' => 'user_pass', 'id_remember' => 'rememberme', 'id_submit' => 'wp-submit', 'label_username' => __( 'Username' ), 'label_password' => __( 'Password' ), 'label_remember' => __( 'Remember Me' ), 'label_log_in' => __( 'Log In' ), 'value_username' => '', 'value_remember' => false ); wp_login_form( $args ); ?>If you want exclude page from CAS authentication you can add them into white list URL in Authorization rules options.
Best regards.
Forum: Plugins
In reply to: [WP Cassify] Subdomain sites and service registriesHi,
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,
Okay, so I close ticket.
Best regards.Forum: Plugins
In reply to: [WP Cassify] Users Roles SettingsOk,
So I close ticket.
Best regards.
Hi,
You’re right !
Please update to version 1.8.0. Keep me informed if it works.Best regards.
Forum: Plugins
In reply to: [WP Cassify] Users Roles SettingsHi,
Please update to version 1.8.0. Keep me informed if it works.
You can display user roles in front page with this :<?php $current_user = wp_get_current_user(); print_r( $current_user->roles ); ?>I’ve replace this code :
// Suscriber role is pushed by default to successfully authenticated user if ( count( $roles_to_push ) == 0 ) { array_push( $roles_to_push, 'subscriber' ); } foreach ( $roles_to_push as $role ) { WP_Cassify_Utils::wp_cassify_set_role_to_wordpress_user( $cas_user_datas[ 'cas_user_id' ], $role ); }By this :
// Suscriber role is pushed by default if wordpress user account has been created. if ( $wordpress_user_account_created ) { array_push( $roles_to_push, 'subscriber' ); } foreach ( $roles_to_push as $role ) { WP_Cassify_Utils::wp_cassify_add_role_to_wordpress_user( $cas_user_datas[ 'cas_user_id' ], $role ); }Forum: Plugins
In reply to: [WP Cassify] User Roles Settings bugSorry for the bug and thank you very much for your reply.