diff options
author | Minteck <contact@minteck.org> | 2022-04-13 09:13:01 +0200 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2022-04-13 09:13:01 +0200 |
commit | 50b7b70a58942474790ac9c65ac58af87e90abb8 (patch) | |
tree | dac847095cdbaeb099c0ca45efd7beb207941dba /oauth/embed | |
parent | b40e7f9f802c0c4bd8e1d27dbca0cbe11faff6d0 (diff) | |
download | session-50b7b70a58942474790ac9c65ac58af87e90abb8.tar.gz session-50b7b70a58942474790ac9c65ac58af87e90abb8.tar.bz2 session-50b7b70a58942474790ac9c65ac58af87e90abb8.zip |
Attempt 1 at fixing broken session
Diffstat (limited to 'oauth/embed')
-rw-r--r-- | oauth/embed/index.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/oauth/embed/index.php b/oauth/embed/index.php index ff47ef0..663d5bc 100644 --- a/oauth/embed/index.php +++ b/oauth/embed/index.php @@ -10,7 +10,7 @@ if (!isset($_GET['code'])) { $appdata = json_decode(file_get_contents("/mnt/familine/private/app.json"), true);
-$crl = curl_init('https://' . $_CONFIG["Global"]["federation"]. '/auth/realms/Familine/protocol/openid-connect/token');
+$crl = curl_init('https://' . $_CONFIG["Global"]["federation"]. '/hub/api/rest/oauth2/token');
curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($crl, CURLINFO_HEADER_OUT, true);
curl_setopt($crl, CURLOPT_POST, true);
@@ -19,8 +19,9 @@ curl_setopt($crl, CURLOPT_HTTPHEADER, [ "Content-Type: application/x-www-form-urlencoded",
"Accept: application/json"
]);
-curl_setopt($crl, CURLOPT_POSTFIELDS, "grant_type=authorization_code&redirect_uri=" . urlencode("https://session." . $_CONFIG["Global"]["domain"] . "/oauth/embed") . "&code=" . $_GET['code']);
+curl_setopt($crl, CURLOPT_POSTFIELDS, "grant_type=authorization_code&redirect_uri=" . urlencode("https://session." . $_CONFIG["Global"]["domain"] . "/oauth/?r=" . $_GET['r']) . "&code=" . $_GET['code']);
+var_dump("grant_type=authorization_code&redirect_uri=" . urlencode("https://" . $_CONFIG["Global"]["domain"] . "/oauth/?r=" . $_GET['r']) . "&code=" . $_GET['code']);
$result = curl_exec($crl);
var_dump($result);
$result = json_decode($result, true);
@@ -28,7 +29,7 @@ $result = json_decode($result, true); curl_close($crl);
if (isset($result["access_token"])) {
- $crl = curl_init('https://' . $_CONFIG["Global"]["federation"]. '/auth/realms/Familine/protocol/openid-connect/userinfo');
+ $crl = curl_init('https://' . $_CONFIG["Global"]["federation"]. '/hub/api/rest/users/me');
curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($crl, CURLINFO_HEADER_OUT, true);
curl_setopt($crl, CURLOPT_HTTPHEADER, [
|