summaryrefslogtreecommitdiffstats
path: root/src/Broker.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Broker.php')
-rw-r--r--src/Broker.php17
1 files changed, 3 insertions, 14 deletions
diff --git a/src/Broker.php b/src/Broker.php
index 4aca418..171b811 100644
--- a/src/Broker.php
+++ b/src/Broker.php
@@ -81,9 +81,9 @@ class Broker
*/
protected function getSessionId()
{
- if (isset($this->token)) return null;
+ if (!isset($this->token)) return null;
- $checksum = hash('sha256', 'session' . $this->token . static::getRemoteAddr() . $this->secret);
+ $checksum = hash('sha256', 'session' . $this->token . $this->secret);
return "SSO-{$this->broker}-{$this->token}-$checksum";
}
@@ -131,7 +131,7 @@ class Broker
'command' => 'attach',
'broker' => $this->broker,
'token' => $this->token,
- 'checksum' => hash('sha256', 'attach' . $this->token . static::getRemoteAddr() . $this->secret)
+ 'checksum' => hash('sha256', 'attach' . $this->token . $this->secret)
] + $_GET;
return $this->url . "?" . http_build_query($data + $params);
@@ -287,15 +287,4 @@ class Broker
return $this->request($method, $command, $args);
}
-
-
- /**
- * Get the client IP address
- *
- * @return string
- */
- protected static function getRemoteAddr()
- {
- return $_SERVER['REMOTE_ADDR'];
- }
}