-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: method signatures after 1.0 release (#427)
- Loading branch information
1 parent
1a468a4
commit 1e85443
Showing
2 changed files
with
55 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
* | ||
* Copyright MITRE 2020 | ||
* | ||
* OpenIDConnectClient for PHP5 | ||
* OpenIDConnectClient for PHP7+ | ||
* Author: Michael Jett <[email protected]> | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); you may | ||
|
@@ -25,7 +25,6 @@ | |
|
||
use Error; | ||
use Exception; | ||
use phpseclib3\Crypt\PublicKeyLoader; | ||
use phpseclib3\Crypt\RSA; | ||
use phpseclib3\Math\BigInteger; | ||
use stdClass; | ||
|
@@ -380,7 +379,7 @@ public function authenticate(): bool | |
$accessToken = $_REQUEST['access_token'] ?? null; | ||
|
||
// Do an OpenID Connect session check | ||
if (!isset($_REQUEST['state']) || ($_REQUEST['state'] !== $this->getState())) { | ||
if (!isset($_REQUEST['state']) || ($_REQUEST['state'] !== $this->getState())) { | ||
throw new OpenIDConnectClientException('Unable to determine state'); | ||
} | ||
|
||
|
@@ -691,7 +690,7 @@ public function getRedirectURL(): string | |
if (isset($_SERVER['HTTP_X_FORWARDED_PORT'])) { | ||
$port = (int)$_SERVER['HTTP_X_FORWARDED_PORT']; | ||
} elseif (isset($_SERVER['SERVER_PORT'])) { | ||
$port = (int)$_SERVER['SERVER_PORT']; | ||
$port = $_SERVER['SERVER_PORT']; | ||
} elseif ($protocol === 'https') { | ||
$port = 443; | ||
} else { | ||
|
@@ -1221,10 +1220,9 @@ protected function urlEncode(string $str): string | |
/** | ||
* @param string $jwt encoded JWT | ||
* @param int $section the section we would like to decode | ||
* @return object | ||
* @return object|null | ||
*/ | ||
protected function decodeJWT(string $jwt, int $section = 0): stdClass { | ||
|
||
protected function decodeJWT(string $jwt, int $section = 0) { | ||
$parts = explode('.', $jwt); | ||
return json_decode(base64url_decode($parts[$section]), false); | ||
} | ||
|
@@ -1688,7 +1686,10 @@ public function revokeToken(string $token, string $token_type_hint = '', string | |
return json_decode($this->fetchURL($revocation_endpoint, $post_params, $headers), false); | ||
} | ||
|
||
public function getClientName(): string | ||
/** | ||
* @return string|null | ||
*/ | ||
public function getClientName() | ||
{ | ||
return $this->clientName; | ||
} | ||
|
@@ -1698,14 +1699,14 @@ public function setClientName(string $clientName) { | |
} | ||
|
||
/** | ||
* @return string | ||
* @return string|null | ||
*/ | ||
public function getClientID() { | ||
return $this->clientID; | ||
} | ||
|
||
/** | ||
* @return string | ||
* @return string|null | ||
*/ | ||
public function getClientSecret() { | ||
return $this->clientSecret; | ||
|
@@ -1720,17 +1721,26 @@ public function setAccessToken(string $accessToken) { | |
$this->accessToken = $accessToken; | ||
} | ||
|
||
public function getAccessToken(): string | ||
/** | ||
* @return string|null | ||
*/ | ||
public function getAccessToken() | ||
{ | ||
return $this->accessToken; | ||
} | ||
|
||
public function getRefreshToken(): string | ||
/** | ||
* @return string|null | ||
*/ | ||
public function getRefreshToken() | ||
{ | ||
return $this->refreshToken; | ||
} | ||
|
||
public function getIdToken(): string | ||
/** | ||
* @return string|null | ||
*/ | ||
public function getIdToken() | ||
{ | ||
return $this->idToken; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters