RefreshTokenEntityNormalizer.php in Simple OAuth (OAuth2) & OpenID Connect 8.2
File
src/Normalizer/RefreshTokenEntityNormalizer.php
View source
<?php
namespace Drupal\simple_oauth\Normalizer;
use Drupal\serialization\Normalizer\NormalizerBase;
use Symfony\Component\Serializer\Normalizer\scalar;
class RefreshTokenEntityNormalizer extends NormalizerBase implements TokenEntityNormalizerInterface {
protected $supportedInterfaceOrClass = '\\League\\OAuth2\\Server\\Entities\\RefreshTokenEntityInterface';
public function normalize($token_entity, $format = NULL, array $context = array()) {
return [
'value' => $token_entity
->getIdentifier(),
'expire' => $token_entity
->getExpiryDateTime()
->format('U'),
];
}
}