Skip to content

Commit f82dfbd

Browse files
authored
Merge pull request #1169 from Sephster/allow-missing-client-redirect-uris
Revert Enforcing of Client Redirect URI
2 parents 70bb329 + cd43b4a commit f82dfbd

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
## [8.2.4] - released 2020-12-09
9+
### Fixed
10+
- Reverted the enforcement of at least one redirect_uri for a client. This change has instead been moved to version 9 (PR #1169)
11+
812
## [8.2.3] - released 2020-12-02
913
### Added
1014
- Re-added support for PHP 7.2 (PR #1165, #1167)
@@ -522,7 +526,8 @@ Version 5 is a complete code rewrite.
522526

523527
- First major release
524528

525-
[Unreleased]: https://github.com/thephpleague/oauth2-server/compare/8.2.3...HEAD
529+
[Unreleased]: https://github.com/thephpleague/oauth2-server/compare/8.2.4...HEAD
530+
[8.2.4]: https://github.com/thephpleague/oauth2-server/compare/8.2.3...8.2.4
526531
[8.2.3]: https://github.com/thephpleague/oauth2-server/compare/8.2.2...8.2.3
527532
[8.2.2]: https://github.com/thephpleague/oauth2-server/compare/8.2.1...8.2.2
528533
[8.2.1]: https://github.com/thephpleague/oauth2-server/compare/8.2.0...8.2.1

src/Grant/AbstractGrant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ protected function getClientEntityOrFail($clientId, ServerRequestInterface $requ
216216
{
217217
$client = $this->clientRepository->getClientEntity($clientId);
218218

219-
if ($client instanceof ClientEntityInterface === false || empty($client->getRedirectUri())) {
219+
if ($client instanceof ClientEntityInterface === false) {
220220
$this->getEmitter()->emit(new RequestEvent(RequestEvent::CLIENT_AUTHENTICATION_FAILED, $request));
221221
throw OAuthServerException::invalidClient($request);
222222
}

src/Grant/AuthCodeGrant.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ public function validateAuthorizationRequest(ServerRequestInterface $request)
261261

262262
if ($redirectUri !== null) {
263263
$this->validateRedirectUri($redirectUri, $client, $request);
264-
} elseif (\is_array($client->getRedirectUri()) && \count($client->getRedirectUri()) !== 1) {
264+
} elseif (empty($client->getRedirectUri()) ||
265+
(\is_array($client->getRedirectUri()) && \count($client->getRedirectUri()) !== 1)) {
265266
$this->getEmitter()->emit(new RequestEvent(RequestEvent::CLIENT_AUTHENTICATION_FAILED, $request));
266267

267268
throw OAuthServerException::invalidClient($request);

0 commit comments

Comments
 (0)