Skip to content

Commit 20d075e

Browse files
authored
Merge pull request #2 from drupol/fix-request-building
Fix token request body building
2 parents 59bb8eb + 3cea3a3 commit 20d075e

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Service/IntrospectionService.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ public function introspect(OpenIDClient $client, string $token, array $params =
5050
$tokenRequest = $this->requestFactory->createRequest('POST', $endpointUri)
5151
->withHeader('content-type', 'application/x-www-form-urlencoded');
5252

53+
$params['token'] = $token;
5354
$tokenRequest = $authMethod->createRequest($tokenRequest, $client, $params);
54-
$tokenRequest->getBody()->write(http_build_query(array_merge($params, [
55-
'token' => $token,
56-
])));
5755

5856
$httpClient = $client->getHttpClient() ?? $this->client;
5957

src/Service/RevocationService.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,8 @@ public function revoke(OpenIDClient $client, string $token, array $params = []):
4848
$tokenRequest = $this->requestFactory->createRequest('POST', $endpointUri)
4949
->withHeader('content-type', 'application/x-www-form-urlencoded');
5050

51+
$params['token'] = $token;
5152
$tokenRequest = $authMethod->createRequest($tokenRequest, $client, $params);
52-
$tokenRequest->getBody()->write(http_build_query(array_merge($params, [
53-
'token' => $token,
54-
])));
5553

5654
$httpClient = $client->getHttpClient() ?? $this->client;
5755

0 commit comments

Comments
 (0)