Skip to content

Commit

Permalink
Redirect to action=wp-saml-auth when redirect_to is persisted
Browse files Browse the repository at this point in the history
This ensures authentication is handled.
  • Loading branch information
danielbachhuber committed Feb 26, 2018
1 parent 5013989 commit 6fdf19c
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 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:** 4.9
**Stable tag:** 0.3.7
**Stable tag:** 0.3.8
**License:** GPLv2 or later
**License URI:** http://www.gnu.org/licenses/gpl-2.0.html

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

## Changelog ##

### 0.3.8 (February 26, 2018) ###
* Redirects to `action=wp-saml-auth` when `redirect_to` is persisted, to ensure authentication is handled [[#115](https://github.com/pantheon-systems/wp-saml-auth/pull/115)].

### 0.3.7 (February 13, 2018) ###
* Persists `redirect_to` value in a more accurate manner, as a follow up to the change in v0.3.6 [[#113](https://github.com/pantheon-systems/wp-saml-auth/pull/113)].

Expand Down
5 changes: 4 additions & 1 deletion inc/class-wp-saml-auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,10 @@ public function do_saml_authentication() {
} elseif ( is_a( $this->provider, 'SimpleSAML_Auth_Simple' ) ) {
$redirect_to = filter_input( INPUT_GET, 'redirect_to', FILTER_SANITIZE_URL );
if ( $redirect_to ) {
$redirect_to = add_query_arg( 'redirect_to', $redirect_to, wp_login_url() );
$redirect_to = add_query_arg( array(
'redirect_to' => $redirect_to,
'action' => 'wp-saml-auth',
), wp_login_url() );
} else {
$redirect_to = wp_login_url();
// Only persist redirect_to when it's not wp-login.php.
Expand Down
2 changes: 1 addition & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<file>.</file>

<!-- Show sniff codes in all reports -->
<arg value="s"/>
<arg value="ps"/>

<rule ref="WordPress-Core" />
<rule ref="WordPress-Docs" />
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: 4.9
Stable tag: 0.3.7
Stable tag: 0.3.8
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

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

== Changelog ==

= 0.3.8 (February 26, 2018) =
* Redirects to `action=wp-saml-auth` when `redirect_to` is persisted, to ensure authentication is handled [[#115](https://github.com/pantheon-systems/wp-saml-auth/pull/115)].

= 0.3.7 (February 13, 2018) =
* Persists `redirect_to` value in a more accurate manner, as a follow up to the change in v0.3.6 [[#113](https://github.com/pantheon-systems/wp-saml-auth/pull/113)].

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: 0.3.7
* Version: 0.3.8
* Description: SAML authentication for WordPress, using SimpleSAMLphp.
* Author: Pantheon
* Author URI: https://pantheon.io
Expand Down

0 comments on commit 6fdf19c

Please sign in to comment.