for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace League\OAuth2\Server\ResponseTypes;
use League\OAuth2\Server\Entities\ClaimSetInterface;
use Psr\Http\Message\ResponseInterface;
use function json_encode;
/**
* A simple user info response for the ResourceServer class
*
* @author Marc Riemer <[email protected]>
*/
class UserInfoResponse extends AbstractResponseType
{
public function __construct(
protected ClaimSetInterface $claimSet
) {
}
* {@inheritdoc}
public function generateHttpResponse(ResponseInterface $response): ResponseInterface
$response = $response
->withStatus(200)
->withHeader('pragma', 'no-cache')
->withHeader('cache-control', 'no-store')
->withHeader('content-type', 'application/json; charset=UTF-8');
$response->getBody()->write(json_encode($this->claimSet->getClaims()));
return $response;
return $response
Psr\Http\Message\MessageInterface
Psr\Http\Message\ResponseInterface