[wip] first impl for getting authorization for admin

This commit is contained in:
2022-05-05 21:31:11 +02:00
parent a7ec843509
commit 5331f1becc
9 changed files with 278 additions and 4 deletions

View File

@@ -0,0 +1,37 @@
<?php
/**
* Chill is a software for social workers
*
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Chill\CalendarBundle\Synchro\Connector\MSGraph;
use Chill\MainBundle\Redis\ChillRedis;
use TheNetworg\OAuth2\Client\Token\AccessToken;
class MachineTokenStorage
{
private const KEY = 'msgraph_access_token';
private ChillRedis $chillRedis;
public function __construct(ChillRedis $chillRedis)
{
$this->chillRedis = $chillRedis;
}
public function getToken(): AccessToken
{
return unserialize($this->chillRedis->get(self::KEY));
}
public function storeToken(AccessToken $token): void
{
$this->chillRedis->set(self::KEY, serialize($token));
}
}