diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e6c249..a46360e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v3.0.0] - 2023-05-05 + +### Added + +- Add option for showing/hiding ID Token from dashboard + +### Changed + +- Update composer dependencies +- Use `jumbojett/openid-connect-php` from composer + +### Fixed + +- Use font awesome from composer +- Use minified CSS and JS +- Handle issuer with trailing slash correctly + +### Removed + +- Remove support for PHP 5 + ## [v2.3.1] - 2022-09-07 ### Fixed diff --git a/README.md b/README.md index 9d2460e..ab5012c 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ First you need to install apache and composer ```shell sudo apt-get update -sudo apt-get install apache2 curl php-cli git +sudo apt-get install apache2 curl php-cli php-json php-xml git php -r "copy('https://getcomposer.org/installer', '/tmp/composer-setup.php');" sudo php /tmp/composer-setup.php --install-dir=/usr/local/bin --filename=composer ``` @@ -55,18 +55,26 @@ tar -zxvf simple-oidc-client-php-X.Y.Z.tar.gz ## Simple OIDC Client - authentication -Now that we have everything we need, we can configure our login settings in +Now that you have everything you need, you can configure your login settings in `config.php`. +First, copy the configuration file, using the command: + +```shell +cp example-config.php config.php +``` + +Then open the file and configure the portal. ```php =5.6", - "phpseclib/phpseclib" : "^2.0", - "ext-json": "*", - "ext-curl": "*", + "php": ">=7.0", "twbs/bootstrap": "^4.0", - "paragonie/random_compat":"2.0.19", "components/jquery": "^3.3", - "components/font-awesome": "^5.15" + "components/font-awesome": "^5.15", + "jumbojett/openid-connect-php": "^0.9" }, "archive" : { "exclude" : [ diff --git a/example-config.php b/example-config.php index bae0157..a0593d9 100644 --- a/example-config.php +++ b/example-config.php @@ -23,9 +23,10 @@ $accessTokenNote = "NOTE: New access tokens expire in 1 hour."; $manageTokenNote = "You can manage your refresh tokens in the following link: "; $manageTokens = $issuer . "manage/user/services"; -$sessionName = "oidc-client"; +$sessionName = "simple-oidc-client-php"; // This value must be the same with the name of the parent directory $sessionLifetime = 60 * 60; // must be equal to access token validation time in seconds $bannerText = ""; $bannerType = "info"; // Select one of "info", "warning", "error" or "success" $allowIntrospection = false; -$enableActiveTokensTable = false; +$enableActiveTokensTable = false; // This option works only for MITREid Connect based OPs +$showIdToken = false; diff --git a/refreshtoken.php b/refreshtoken.php index 4d253a0..42595b5 100644 --- a/refreshtoken.php +++ b/refreshtoken.php @@ -21,6 +21,13 @@
ID Token:
+ + +Access Token:
diff --git a/resources/controllers/session.php b/resources/controllers/session.php index cd0f91b..c3cfa8f 100644 --- a/resources/controllers/session.php +++ b/resources/controllers/session.php @@ -58,22 +58,26 @@ $sub = $oidc->requestUserInfo('sub'); if ($sub) { $accessToken = $_SESSION['access_token']; + $idToken = $_SESSION['id_token']; $_SESSION['refresh_token'] = $refreshToken; } unset($_SESSION['action']); } else { $accessToken = $_SESSION['access_token']; + $idToken = $oidc->getIdToken(); $refreshToken = $_SESSION['refresh_token']; unset($_SESSION['action']); } } else { $oidc->authenticate(); $accessToken = $oidc->getAccessToken(); + $idToken = $oidc->getIdToken(); $refreshToken = $oidc->getRefreshToken(); $sub = $oidc->requestUserInfo('sub'); if ($sub) { $_SESSION['sub'] = $sub; $_SESSION['access_token'] = $accessToken; + $_SESSION['id_token'] = $idToken; $_SESSION['refresh_token'] = $refreshToken; $_SESSION['CREATED'] = time(); } diff --git a/src/OpenIDConnectClient.php b/src/OpenIDConnectClient.php deleted file mode 100644 index 2bad8b5..0000000 --- a/src/OpenIDConnectClient.php +++ /dev/null @@ -1,1945 +0,0 @@ - - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may - * not use this file except in compliance with the License. You may obtain - * a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations - * under the License. - * - */ - -namespace Jumbojett; - -/** - * - * JWT signature verification support by Jonathan Reed