Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [unreleased]

### Changed
- Removed duplicates from scopes generated strings.

## [unreleased]

### Changed
- Stop adding ?schema=openid to userinfo endpoint URL. #449

Expand Down
4 changes: 2 additions & 2 deletions src/OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ public function verifyLogoutTokenClaims($claims): bool
* @param array $scope - example: openid, given_name, etc...
*/
public function addScope(array $scope) {
$this->scopes = array_merge($this->scopes, $scope);
$this->scopes = array_unique(array_merge($this->scopes, $scope));
}

/**
Expand Down Expand Up @@ -760,7 +760,7 @@ private function requestAuthorization() {

// If the client has been registered with additional scopes
if (count($this->scopes) > 0) {
$auth_params = array_merge($auth_params, ['scope' => implode(' ', array_merge($this->scopes, ['openid']))]);
$auth_params = array_merge($auth_params, ['scope' => implode(' ', array_unique(array_merge($this->scopes, ['openid'])))]);
}

// If the client has been registered with additional response types
Expand Down