| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- declare(strict_types=1);
- namespace App\ApiResources\HelloAsso;
- use ApiPlatform\Metadata\ApiProperty;
- use ApiPlatform\Metadata\ApiResource;
- use ApiPlatform\Metadata\Get;
- use App\State\Provider\HelloAsso\AuthUrlProvider;
- /**
- * Ressource contenant l'URL d'authentification HelloAsso et le vérificateur de défi PKCE.
- */
- #[ApiResource(
- operations: [
- new Get(
- uriTemplate: '/helloasso/auth-url',
- ),
- ],
- provider: AuthUrlProvider::class,
- security: '(is_granted("ROLE_ORGANIZATION")'
- )]
- class AuthUrl
- {
- /**
- * Id 'bidon' ajouté par défaut pour permettre la construction
- * de l'IRI par api platform.
- */
- #[ApiProperty(identifier: true)]
- private int $id = 1;
- /**
- * URL d'authentification HelloAsso pour l'autorisation OAuth2.
- */
- private string $authUrl;
- /**
- * Vérificateur de défi PKCE pour sécuriser l'échange OAuth2.
- */
- private string $challengeVerifier;
- public function getId(): int
- {
- return $this->id;
- }
- public function setId(int $id): self
- {
- $this->id = $id;
- return $this;
- }
- public function getAuthUrl(): string
- {
- return $this->authUrl;
- }
- public function setAuthUrl(string $authUrl): self
- {
- $this->authUrl = $authUrl;
- return $this;
- }
- public function getChallengeVerifier(): string
- {
- return $this->challengeVerifier;
- }
- public function setChallengeVerifier(string $challengeVerifier): self
- {
- $this->challengeVerifier = $challengeVerifier;
- return $this;
- }
- }
|