Skip to content
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Support for signed and encrypted ID Token. #305
* Update construct typehint in docblock. #364
* Fixed LogoutToken verification for single value aud claims #334
* Added function to set useragent #370

### Added
- Support for signed and encrypted UserInfo response. #305
Expand Down
6 changes: 6 additions & 0 deletions src/OpenIDConnectClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -1367,6 +1367,7 @@ protected function fetchURL(string $url, string $post_body = null, array $header
// Allows to keep the POST method even after redirect
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_body);
curl_setopt($ch, CURLOPT_USERAGENT, $this->getUserAgent());

// Default content type is form encoded
$content_type = 'application/x-www-form-urlencoded';
Expand Down Expand Up @@ -2058,4 +2059,9 @@ public function supportsAuthMethod(string $auth_method, array $token_endpoint_au

return in_array($auth_method, $token_endpoint_auth_methods_supported, true);
}

protected function getUserAgent(): string
{
return "jumbojett/OpenID-Connect-PHP";
}
}