diff options
-rw-r--r-- | examples/consumer/try_auth.php | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/consumer/try_auth.php b/examples/consumer/try_auth.php index c5f7ef5..464dd1f 100644 --- a/examples/consumer/try_auth.php +++ b/examples/consumer/try_auth.php @@ -11,12 +11,17 @@ if (empty($_GET['openid_url'])) { exit(0); } +$scheme = 'http'; +if (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') { + $scheme .= 's'; +} + $openid = $_GET['openid_url']; -$process_url = sprintf("http://%s:%s%s/finish_auth.php", +$process_url = sprintf("$scheme://%s:%s%s/finish_auth.php", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], dirname($_SERVER['PHP_SELF'])); -$trust_root = sprintf("http://%s:%s%s", +$trust_root = sprintf("$scheme://%s:%s%s", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], dirname($_SERVER['PHP_SELF'])); |