Skip to content

Commit

Permalink
Merge pull request #62 from humanmade/backport-59-to-v7-branch
Browse files Browse the repository at this point in the history
[Backport v7-branch] Fix port for SAML login
  • Loading branch information
roborourke authored Jul 30, 2021
2 parents 2996bec + 9bff51f commit a4a604b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions inc/saml/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
* @return void
*/
function bootstrap() {
// Set server port to 443 or 80 for SAML, port 8080 breaks validation.
if ( class_exists( '\\OneLogin\\Saml2\\Utils' ) ) {
$is_https = ! empty( $_SERVER['HTTPS'] ) && $_SERVER['HTTPS'] === 'on';
\OneLogin\Saml2\Utils::setSelfPort( $is_https ? '443' : '80' );
}

add_filter( 'wpsimplesaml_network_activated', '__return_true' );
add_filter( 'wpsimplesaml_idp_metadata_xml_path', __NAMESPACE__ . '\\get_idp_metadata_file_path' );
add_filter( 'pre_site_option_sso_sp_base', __NAMESPACE__ . '\\get_sp_client_id' );
Expand Down

0 comments on commit a4a604b

Please sign in to comment.