mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
42 lines
1.4 KiB
PHP
42 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
/*
|
|
* 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.
|
|
*/
|
|
|
|
namespace Chill\DocStoreBundle\Security\Guard;
|
|
|
|
use Lexik\Bundle\JWTAuthenticationBundle\Security\Guard\JWTTokenAuthenticator;
|
|
use Lexik\Bundle\JWTAuthenticationBundle\Services\JWTTokenManagerInterface;
|
|
use Lexik\Bundle\JWTAuthenticationBundle\TokenExtractor\TokenExtractorInterface;
|
|
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
|
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface;
|
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
|
|
|
/**
|
|
* Alter the base JWTTokenAuthenticator to add the special extractor for dav url endpoints.
|
|
*/
|
|
class JWTOnDavUrlAuthenticator extends JWTTokenAuthenticator
|
|
{
|
|
public function __construct(
|
|
JWTTokenManagerInterface $jwtManager,
|
|
EventDispatcherInterface $dispatcher,
|
|
TokenExtractorInterface $tokenExtractor,
|
|
private readonly DavOnUrlTokenExtractor $davOnUrlTokenExtractor,
|
|
TokenStorageInterface $preAuthenticationTokenStorage,
|
|
TranslatorInterface $translator = null,
|
|
) {
|
|
parent::__construct($jwtManager, $dispatcher, $tokenExtractor, $preAuthenticationTokenStorage, $translator);
|
|
}
|
|
|
|
protected function getTokenExtractor()
|
|
{
|
|
return $this->davOnUrlTokenExtractor;
|
|
}
|
|
}
|