Skip to content

Commit

Permalink
Merge pull request #2 from drupol/fix-request-building
Browse files Browse the repository at this point in the history
Fix token request body building
  • Loading branch information
thomasvargiu authored Mar 11, 2021
2 parents 59bb8eb + 3cea3a3 commit 20d075e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions src/Service/IntrospectionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,8 @@ public function introspect(OpenIDClient $client, string $token, array $params =
$tokenRequest = $this->requestFactory->createRequest('POST', $endpointUri)
->withHeader('content-type', 'application/x-www-form-urlencoded');

$params['token'] = $token;
$tokenRequest = $authMethod->createRequest($tokenRequest, $client, $params);
$tokenRequest->getBody()->write(http_build_query(array_merge($params, [
'token' => $token,
])));

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

Expand Down
4 changes: 1 addition & 3 deletions src/Service/RevocationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,8 @@ public function revoke(OpenIDClient $client, string $token, array $params = []):
$tokenRequest = $this->requestFactory->createRequest('POST', $endpointUri)
->withHeader('content-type', 'application/x-www-form-urlencoded');

$params['token'] = $token;
$tokenRequest = $authMethod->createRequest($tokenRequest, $client, $params);
$tokenRequest->getBody()->write(http_build_query(array_merge($params, [
'token' => $token,
])));

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

Expand Down

0 comments on commit 20d075e

Please sign in to comment.