Skip to content

Commit

Permalink
Merge pull request #255 from pantheon-systems/allow-internal-logout-a…
Browse files Browse the repository at this point in the history
…rgs-filter

Allow the internal logout args to be filterable
  • Loading branch information
danielbachhuber authored Aug 18, 2021
2 parents df80cb8 + 26d4cbf commit c72d545
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
**Tags:** authentication, SAML
**Requires at least:** 4.4
**Tested up to:** 5.8
**Stable tag:** 1.2.3
**Stable tag:** 1.2.4
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -277,6 +277,9 @@ There is no third step. Because SimpleSAMLphp loads WordPress, which has WP Nati

## Changelog ##

### 1.2.4 (August 18, 2021) ###
* Adds a `wp_saml_auth_internal_logout_args` filter to allow the internal logout args to be filterable [[#255](https://github.com/pantheon-systems/wp-saml-auth/pull/255)].

### 1.2.3 (May 25, 2021) ###
* Adds a `wp_saml_auth_force_authn` filter to allow forceAuthn="true" to be enabled [[#248](https://github.com/pantheon-systems/wp-saml-auth/pull/248)].

Expand Down
20 changes: 19 additions & 1 deletion inc/class-wp-saml-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,26 @@ public function action_wp_logout() {
if ( empty( $internal_config['idp']['singleLogoutService']['url'] ) ) {
return;
}
$args = array(
'parameters' => array(),
'nameId' => null,
'sessionId' => null,
);
/**
* Permit the arguments passed to the logout() method to be customized.
*
* @param array $args Existing arguments to be passed.
*/
$args = apply_filters( 'wp_saml_auth_internal_logout_args', $args );
$provider->logout(
add_query_arg( 'loggedout', true, wp_login_url() ),
$args['parameters'],
$args['nameId'],
$args['sessionIndex']
);
} else {
$provider->logout( add_query_arg( 'loggedout', true, wp_login_url() ) );
}
$provider->logout( add_query_arg( 'loggedout', true, wp_login_url() ) );
}

/**
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: getpantheon, danielbachhuber, Outlandish Josh
Tags: authentication, SAML
Requires at least: 4.4
Tested up to: 5.8
Stable tag: 1.2.3
Stable tag: 1.2.4
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -277,6 +277,9 @@ There is no third step. Because SimpleSAMLphp loads WordPress, which has WP Nati

== Changelog ==

= 1.2.4 (August 18, 2021) =
* Adds a `wp_saml_auth_internal_logout_args` filter to allow the internal logout args to be filterable [[#255](https://github.com/pantheon-systems/wp-saml-auth/pull/255)].

= 1.2.3 (May 25, 2021) =
* Adds a `wp_saml_auth_force_authn` filter to allow forceAuthn="true" to be enabled [[#248](https://github.com/pantheon-systems/wp-saml-auth/pull/248)].

Expand Down
2 changes: 1 addition & 1 deletion wp-saml-auth.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Plugin Name: WP SAML Auth
* Version: 1.2.3
* Version: 1.2.4
* Description: SAML authentication for WordPress, using SimpleSAMLphp.
* Author: Pantheon
* Author URI: https://pantheon.io
Expand Down

0 comments on commit c72d545

Please sign in to comment.