Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sync from base through 0.9.10 #3

Open
wants to merge 83 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
a5510d2
Added userInfo response type check to handle signed and encrypted res…
ricklambrechts Jun 13, 2022
d6aa989
feat: add client_secret_jwt support
andreipopa-who Jul 21, 2022
5305713
fix: use empty array as fallback if the IdP is not exposing/supportin…
DeepDiver1975 Aug 5, 2022
f2f74b9
Merge pull request #317 from jumbojett/fix/fallback-code_challenge_me…
DeepDiver1975 Aug 5, 2022
1f80014
Release 0.9.8
DeepDiver1975 Aug 5, 2022
96b1295
Merge pull request #318 from jumbojett/release/0.9.8
DeepDiver1975 Aug 5, 2022
1956de3
Use consistent spacing
timvisee Aug 26, 2022
ffb8d38
linting: Update src/OpenIDConnectClient.php
andreipopa-who Sep 15, 2022
626a8ae
Merge branch 'jumbojett:master' into handle-application-jwt
ricklambrechts Sep 15, 2022
e8db274
use correct types
ricklambrechts Sep 15, 2022
1b4b69f
set response as jwt when not jwe
ricklambrechts Sep 15, 2022
5ed9bd9
Added id token jwe decryption
ricklambrechts Sep 15, 2022
5832c8e
Added support for private_key_jwt authentication method
ricklambrechts Sep 15, 2022
e535cbc
use __invoke for supporting older php versions
ricklambrechts Sep 15, 2022
bddb3bf
Updated changelog
ricklambrechts Sep 16, 2022
f3196f3
Updated changelog
ricklambrechts Sep 16, 2022
ed0e30a
fix: harden self signed JWK header
DeepDiver1975 Sep 26, 2022
3c896de
Merge pull request #319 from timvisee/master
DeepDiver1975 Sep 26, 2022
7672086
Merge pull request #323 from jumbojett/fix/harden-self-signed-jwk-header
DeepDiver1975 Sep 27, 2022
eeb23dd
Merge latest and fix conflicts
mig5 Sep 28, 2022
c7c6aca
Add changelog entry and documentation in the README for back-channel …
mig5 Sep 28, 2022
fba1440
Merge pull request #322 from ricklambrechts/add-support-for-private-k…
DeepDiver1975 Sep 28, 2022
12b9a53
Merge branch 'master' of github.com:andreipopa-who/OpenID-Connect-PHP…
DeepDiver1975 Sep 28, 2022
6b9a39f
Merge pull request #324 from jumbojett/andreipopa-who-master
DeepDiver1975 Sep 28, 2022
1161b77
fix: $this->enc_type -> $this->encType
DeepDiver1975 Sep 28, 2022
7883f6c
Merge pull request #302 from mig5/back-channel-logout
DeepDiver1975 Sep 28, 2022
db9a25c
chore: code cleanup of back-channel PR #302
DeepDiver1975 Sep 28, 2022
31354e8
Merge pull request #325 from jumbojett/fix/enc-type
DeepDiver1975 Sep 28, 2022
4046c22
Merge pull request #326 from jumbojett/fix/cleanup-back-channel
DeepDiver1975 Sep 28, 2022
f69b40f
Release 0.9.9
DeepDiver1975 Sep 28, 2022
a135c5d
Merge pull request #328 from jumbojett/release/0.9.9
DeepDiver1975 Sep 28, 2022
89bdf7c
fix: client_secret_jwt and private_key_jwt support is disabled by def…
DeepDiver1975 Sep 29, 2022
0e2fbc3
Merge pull request #331 from jumbojett/fix/client_secret_jwt-configur…
DeepDiver1975 Sep 30, 2022
45aac47
Release v0.9.10
DeepDiver1975 Sep 30, 2022
6aae75b
Merge pull request #332 from jumbojett/release/0.9.10
DeepDiver1975 Sep 30, 2022
4338e85
Fix LogoutToken verification for single value `aud` claims
Sep 30, 2022
7cb7590
Add Changelog entry
Sep 30, 2022
05964b3
Remove unnecessary method overrides in UnitTest
Sep 30, 2022
eb26fe2
Merge branch 'master' into handle-application-jwt
ricklambrechts Oct 6, 2022
e3c3f9a
Removed interface and added function that can be extended to add the …
ricklambrechts Oct 6, 2022
4d67728
docs: fix getSubjectFromBackChannel in README
melanger Nov 22, 2022
2d78c15
Merge pull request #346 from melanger/patch-1
azmeuk Nov 25, 2022
7a7dbec
Fix return type
akhil1508 Dec 12, 2022
102a5bb
Merge pull request #305 from ricklambrechts/handle-application-jwt
DeepDiver1975 Dec 14, 2022
a4776d1
Add an extra check on $_REQUEST['state']
kastoras Jan 3, 2023
ed5ccd9
Fix if statement to throw error instead of bypass
kastoras Jan 10, 2023
8a80c1a
Correct variable docstring
akhil1508 Jan 12, 2023
5c90e0f
Merge pull request #350 from akhil1508/correct-return-type
azmeuk Jan 12, 2023
13e86af
docs: fix changelog format
melanger Jan 13, 2023
b6cc813
Update CHANGELOG.md
kastoras Jan 19, 2023
a38cf08
Merge pull request #358 from melanger/patch-3
azmeuk Mar 10, 2023
abe958f
Merge branch 'master' into fix-php-8-warning-on-authenticate
kastoras Mar 16, 2023
9483fff
Merge pull request #354 from kastoras/fix-php-8-warning-on-authenticate
azmeuk Mar 16, 2023
e94b9eb
chore: Update construct typehint in docblock (#364)
ricklambrechts Mar 29, 2023
20b51cb
chore: Update visibility of getWellKnownConfigValue to protected (#363)
ricklambrechts Mar 29, 2023
dd9ceb0
Merge branch 'master' into Fix_LogoutToken_Validation_AUD_Claim
Mar 29, 2023
e46f108
Merge pull request #334 from hallowelt/Fix_LogoutToken_Validation_AUD…
azmeuk Mar 29, 2023
e6eab93
feat: php7.0 minimum requirement (#327)
DeepDiver1975 May 3, 2023
8ec206b
feat: set useragent (#370)
ricklambrechts May 4, 2023
c146b71
fix: Update well known config value function response types (#376)
ricklambrechts Jul 26, 2023
5d69bcf
Set the User-Agent regardless of GET or POST (#382)
mig5 Aug 1, 2023
7be38be
release: 1.0.0 (#402)
DeepDiver1975 Dec 13, 2023
4e32595
chore: Update ci to support php 8.3 and add dependabot (#407)
ricklambrechts Apr 22, 2024
73af840
docs: Update README.md to correct addScope parameter type in 1.0.0 (#…
jasongill Apr 22, 2024
6ac3ed4
chore(deps): bump actions/checkout from 2 to 4 (#416)
dependabot[bot] Apr 22, 2024
f5fadf1
chore(deps): bump actions/cache from 3 to 4 (#417)
dependabot[bot] Apr 22, 2024
e31ec33
fix: Cast SERVER_PORT to integer (#404)
timsmid Apr 22, 2024
0c8f54d
fix: Check if subject is equal to subject of id token when verifying …
ricklambrechts Apr 22, 2024
1a468a4
fix: Removed duplicate check on jwks_uri and only check if jwks_uri e…
ricklambrechts Apr 23, 2024
1e85443
fix: method signatures after 1.0 release (#427)
DeepDiver1975 Sep 5, 2024
0509be8
fix: handle JWT decode of non JWT tokens (#428)
DeepDiver1975 Sep 5, 2024
0fbf8f2
chore: enable dependabot for composer (#429)
DeepDiver1975 Sep 5, 2024
036530b
ci: run GitHub workflows on pull requests and pushes to master (#431)
DeepDiver1975 Sep 5, 2024
e316397
chore(deps): update phpseclib/phpseclib requirement from ~3.0 to ^3.0.7
artemboyko43 Sep 5, 2024
2256030
chore(deps-dev): update yoast/phpunit-polyfills requirement from ^1.0…
dependabot[bot] Sep 5, 2024
765ddbd
fix: protected $responseCode to allow proper overloading of fetchURL(…
DeepDiver1975 Sep 6, 2024
7569311
release: v1.0.1 (#432)
DeepDiver1975 Sep 6, 2024
db1ed8b
fix: bring back #404 (#437)
DeepDiver1975 Sep 13, 2024
a5994e7
test: add unit test for SERVER_PORT type cast (#438)
DeepDiver1975 Sep 13, 2024
9af21bd
release: v1.0.2 (#439)
DeepDiver1975 Sep 13, 2024
60919af
Fix TypeError in `verifyJWTClaims` (#442)
osnard Sep 17, 2024
97adbce
test: unit tests for verifyJWTClaims and different aud claims (#443)
DeepDiver1975 Sep 18, 2024
f7c91b9
fix: protected responseContentType to allow overloading of fetchUrl f…
ricklambrechts Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2

updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

# Maintain dependencies for composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
18 changes: 12 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
---
name: build

on: [push, pull_request]
on:
push:
branches:
- master
pull_request:
branches:
- master

env:
DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi"
Expand All @@ -14,25 +20,25 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
php: ['7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3']

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache composer dependencies
uses: actions/cache@v1
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install dependencies
run: composer update $DEFAULT_COMPOSER_FLAGS
- name: Run unit tests
run: vendor/bin/phpunit --verbose --colors=always tests
run: vendor/bin/phpunit --colors=always tests
231 changes: 132 additions & 99 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,161 +1,194 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
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).

## [unreleased]
## [1.0.1] - 2024-09-13

## [0.9.7]
### Fixed
- Cast `$_SERVER['SERVER_PORT']` to integer to prevent adding 80 or 443 port to redirect URL. #437

### Added
## [1.0.1] - 2024-09-05

### Fixed
- Fix JWT decode of non JWT tokens #428
- Fix method signatures #427
- Cast `$_SERVER['SERVER_PORT']` to integer to prevent adding 80 or 443 port to redirect URL. #403
- Check subject when verifying JWT #406
- Removed duplicate check on jwks_uri and only check if jwks_uri exists when needed #373

* Support for Self-Contained JWTs. #308
* Support for RFC8693 Token Exchange Request. #275
## [1.0.0] - 2023-12-13

### Added
- PHP 7.0 is required. #327
- Support for signed and encrypted UserInfo response and ID Token. #305
- Allow to set User-Agent header. #370

### Fixed
- User-Agent is set for any HTTP method in fetchURL() (not just POST). #382
- Update visibility of getWellKnownConfigValue to protected. #363
- Fixed issue on authentication for php8. #354
- Update construct typehint in docblock. #364
- Fixed LogoutToken verification for single value aud claims. #334
- Update well known config value function response types. #376

* PHP 5.4 compatibility. #304
* Use session_status(). #306
## [0.9.10] - 2022-09-30

### Fixed
- `private_key_jwt` and `client_secret_jwt` need to explicitly be enabled #331

## [0.9.6]
## [0.9.9] - 2022-09-28

### Added
- Added support for back-channel logout. #302
- Added support for `private_key_jwt` Client Authentication method #322
- Added support for `client_secret_jwt` Client Authentication method #324
- Added PS512 encryption support #342

* Support for [phpseclib/phpseclib](https://phpseclib.com/) version **3**. #260
* Support client_secret on token endpoint with PKCE. #293
* Added new parameter to `requestTokens()` to pass custom HTTP headers #297
### Fixed
- Harden self-signed JWK header usage. #323

### Changed
## [0.9.8] - 2022-08-05

* Allow serializing `OpenIDConnectClient` using `serialize()` #295
### Fixed
- Do not use PKCE if IdP does not support it. #317

## [0.9.5]
## [0.9.7] - 2022-07-13

### Changed
### Added
- Support for Self-Contained JWTs. #308
- Support for RFC8693 Token Exchange Request. #275

* signOut() Method parameter $accessToken -> $idToken to prevent confusion about access and id tokens usage. #127
* Fixed issue where missing nonce within the claims was causing an exception. #280
### Fixed
- PHP 5.4 compatibility. #304
- Use session_status(). #306

## [0.9.4]
## [0.9.6] - 2022-05-08

### Added
- Support for [phpseclib/phpseclib](https://phpseclib.com/) version **3**. #260
- Support client_secret on token endpoint with PKCE. #293
- Added new parameter to `requestTokens()` to pass custom HTTP headers #297

### Changed
- Allow serializing `OpenIDConnectClient` using `serialize()` #295

## [0.9.5] - 2021-11-24

* Enabled `client_secret_basic` authentication on `refreshToken()` #215
* Basic auth support for requestResourceOwnerToken #271
### Changed
- signOut() Method parameter $accessToken -> $idToken to prevent confusion about access and id tokens usage. #127
- Fixed issue where missing nonce within the claims was causing an exception. #280

## [0.9.3]
## [0.9.4] - 2021-11-21

### Added
- Enabled `client_secret_basic` authentication on `refreshToken()` #215
- Basic auth support for requestResourceOwnerToken #271

## [0.9.3] - 2021-11-20

* getRedirectURL() will not log a warning for PHP 7.1+ #179
* it is now possible to disable upgrading from HTTP to HTTPS for development purposes by calling `setHttpUpgradeInsecureRequests(false)` #241
* bugfix in getSessionKey when _SESSION key does not exist #251
* Added scope parameter to refresh token request #225
* bugfix in verifyJWTclaims when $accessToken is empty and $claims->at_hash is not #276
* bugfix with the `empty` function in PHP 5.4 #267
### Added
- getRedirectURL() will not log a warning for PHP 7.1+ #179
- it is now possible to disable upgrading from HTTP to HTTPS for development purposes by calling `setHttpUpgradeInsecureRequests(false)` #241
- bugfix in getSessionKey when _SESSION key does not exist #251
- Added scope parameter to refresh token request #225
- bugfix in `verifyJWTclaims` when $accessToken is empty and $claims->at_hash is not #276
- bugfix with the `empty` function in PHP 5.4 #267

## [0.9.2]
## [0.9.2] - 2020-11-16

### Added
* Support for [PKCE](https://tools.ietf.org/html/rfc7636). Currently the supported methods are 'plain' and 'S256'.
- Support for [PKCE](https://tools.ietf.org/html/rfc7636). Currently, the supported methods are 'plain' and 'S256'.

## [0.9.1]
## [0.9.1] - 2020-08-27

### Added
* Add support for MS Azure Active Directory B2C user flows
- Add support for MS Azure Active Directory B2C user flows

### Changed
* Fix at_hash verification #200
* Getters for public parameters #204
* Removed client ID query parameter when making a token request using Basic Auth
* Use of `random_bytes()` for token generation instead of `uniqid()`; polyfill for PHP < 7.0 provided.
- Fix at_hash verification #200
- Getters for public parameters #204
- Removed client ID query parameter when making a token request using Basic Auth
- Use of `random_bytes()` for token generation instead of `uniqid()`; polyfill for PHP < 7.0 provided.

### Removed
* Removed explicit content-length header - caused issues with proxy servers

- Removed explicit content-length header - caused issues with proxy servers

## [0.9.0]
## [0.9.0] - 2020-03-09

### Added
* php 7.4 deprecates array_key_exists on objects, use property_exists in getVerifiedClaims and requestUserInfo
* Adding a header to indicate JSON as the return type for userinfo endpoint #151
* ~Updated OpenIDConnectClient to conditionally verify nonce #146~
* Add possibility to change enc_type parameter for http_build_query #155
* Adding OAuth 2.0 Token Introspection #156
* Add optional parameters clientId/clientSecret for introspection #157 & #158
* Adding OAuth 2.0 Token Revocation #160
* Adding issuer validator #145
* Adding signing algorithm PS256 #180
* Check http status of request user info #186
* URL encode clientId and clientSecret when using basic authentication, according to https://tools.ietf.org/html/rfc6749#section-2.3.1 #192
* Adjust PHPDoc to state that null is also allowed #193
- php 7.4 deprecates array_key_exists on objects, use property_exists in getVerifiedClaims and requestUserInfo
- Adding a header to indicate JSON as the return type for userinfo endpoint #151
- ~Updated OpenIDConnectClient to conditionally verify nonce #146~
- Add possibility to change enc_type parameter for http_build_query #155
- Adding OAuth 2.0 Token Introspection #156
- Add optional parameters clientId/clientSecret for introspection #157 & #158
- Adding OAuth 2.0 Token Revocation #160
- Adding issuer validator #145
- Adding signing algorithm PS256 #180
- Check http status of request user info #186
- URL encode clientId and clientSecret when using basic authentication, according to https://tools.ietf.org/html/rfc6749#section-2.3.1 #192
- Adjust PHPDoc to state that null is also allowed #193

### Changed
* Bugfix/code cleanup #152
* Cleanup PHPDoc #46e5b59
* Replace unnecessary double quotes with single quotes #2a76b57
* Use original function names instead of aliases #1f37892
* Remove unnecessary default values #5ab801e
* Explicit declare field $redirectURL #9187c0b
* Remove unused code #1e65384
* Fix indent #e9cdf56
* Cleanup conditional code flow for better readability #107f3fb
* Added strict type comparisons #167
* Bugfix: required `openid` scope was omitted when additional scopes were registered using `addScope` method. This resulted in failing OpenID process.

## [0.8.0]
- Bugfix/code cleanup #152
- Cleanup PHPDoc #46e5b59
- Replace unnecessary double quotes with single quotes #2a76b57
- Use original function names instead of aliases #1f37892
- Remove unnecessary default values #5ab801e
- Explicit declare field $redirectURL #9187c0b
- Remove unused code #1e65384
- Fix indent #e9cdf56
- Cleanup conditional code flow for better readability #107f3fb
- Added strict type comparisons #167
- Bugfix: required `openid` scope was omitted when additional scopes were registered using `addScope` method. This resulted in failing OpenID process.

## [0.8.0] - 2019-01-02

### Added
* Fix `verifyJWTsignature()`: verify JWT to prevent php errors and warnings on invalid token
- Fix `verifyJWTsignature()`: verify JWT to prevent php errors and warnings on invalid token

### Changed
* Decouple session manipulation, it's allow use of other session libraries #134
* Broaden version requirements of the phpseclib/phpseclib package. #144
- Decouple session manipulation, it's allow use of other session libraries #134
- Broaden version requirements of the phpseclib/phpseclib package. #144

## [0.7.0]
## [0.7.0] - 2018-10-15

### Added
* Add "license" field to composer.json #138
* Ensure key_alg is set when getting key #139
* Add option to send additional registration parameters like post_logout_redirect_uris. #140
- Add "license" field to composer.json #138
- Ensure key_alg is set when getting key #139
- Add option to send additional registration parameters like post_logout_redirect_uris. #140

### Changed
* disabled autoload for Crypt_RSA + makre refreshToken() method tolerant for errors #137

### Removed
*
- disabled autoload for Crypt_RSA + make refreshToken() method tolerant for errors #137

## [0.6.0]
## [0.6.0] - 2018-07-17

### Added
* Added five minutes leeway due to clock skew between openidconnect server and client.
* Fix save access_token from request in implicit flow authentication #129
* verifyJWTsignature() method private -> public #126
* Support for providers where provider/login URL is not the same as the issuer URL. #125
* Support for providers that has a different login URL from the issuer URL, for instance Azure Active Directory. Here, the provider URL is on the format: https://login.windows.net/(tenant-id), while the issuer claim actually is on the format: https://sts.windows.net/(tenant-id).
- Added five minutes leeway due to clock skew between openidconnect server and client.
- Fix save access_token from request in implicit flow authentication #129
- `verifyJWTsignature()` method private -> public #126
- Support for providers where provider/login URL is not the same as the issuer URL. #125
- Support for providers that has a different login URL from the issuer URL, for instance Azure Active Directory. Here, the provider URL is on the format: https://login.windows.net/(tenant-id), while the issuer claim actually is on the format: https://sts.windows.net/(tenant-id).

### Changed
* refreshToken method update #124
- refreshToken method update #124

### Removed
*

## [0.5.0]
## Added
* Implement Azure AD B2C Implicit Workflow
## [0.5.0] - 2018-04-09

## [0.4.1]
## Changed
* Documentation updates for include path.

## [0.4]
### Added
* Timeout is configurable via setTimeout method. This addresses issue #94.
* Add the ability to authenticate using the Resource Owner flow (with or without the Client ID and ClientSecret). This addresses issue #98
* Add support for HS256, HS512 and HS384 signatures
* Removed unused calls to $this->getProviderConfigValue("token_endpoint_…
- Implement Azure AD B2C Implicit Workflow

## [0.4.1] - 2018-02-16

### Changed
- Documentation updates for include path.

### Removed
## [0.4.0] - 2018-02-15

### Added
- Timeout is configurable via setTimeout method. This addresses issue #94.
- Add the ability to authenticate using the Resource Owner flow (with or without the Client ID and ClientSecret). This addresses issue #98
- Add support for HS256, HS512 and HS384 signatures
- Removed unused calls to $this->getProviderConfigValue("token_endpoint_…
Loading