diff --git a/includes/openid-connect-generic-client-wrapper.php b/includes/openid-connect-generic-client-wrapper.php index fcfc319d..69569311 100644 --- a/includes/openid-connect-generic-client-wrapper.php +++ b/includes/openid-connect-generic-client-wrapper.php @@ -111,8 +111,9 @@ public static function register( OpenID_Connect_Generic_Client $client, OpenID_C } if ( $settings->alternate_redirect_uri ) { + $redirect_uri = apply_filters( 'openid-connect-generic-alter-alternate-redirect-uri', 'openid-connect-authorize' ); // Provide an alternate route for authentication_request_callback. - add_rewrite_rule( '^openid-connect-authorize/?', 'index.php?openid-connect-authorize=1', 'top' ); + add_rewrite_rule( '^' . $redirect_uri . '/?', 'index.php?openid-connect-authorize=1', 'top' ); add_rewrite_tag( '%openid-connect-authorize%', '1' ); add_action( 'parse_request', array( $client_wrapper, 'alternate_redirect_uri_parse_request' ) ); } diff --git a/includes/openid-connect-generic-settings-page.php b/includes/openid-connect-generic-settings-page.php index 070eb693..cc2ac98b 100644 --- a/includes/openid-connect-generic-settings-page.php +++ b/includes/openid-connect-generic-settings-page.php @@ -417,7 +417,8 @@ public function settings_page() { $redirect_uri = admin_url( 'admin-ajax.php?action=openid-connect-authorize' ); if ( $this->settings->alternate_redirect_uri ) { - $redirect_uri = site_url( '/openid-connect-authorize' ); + $redirect_uri = apply_filters( 'openid-connect-generic-alter-alternate-redirect-uri', 'openid-connect-authorize' ); + $redirect_uri = site_url( '/' . $redirect_uri ); } ?>