1 | <?php |
||
11 | class Oauth2ServiceAccountStrategy implements AuthStrategyInterface, CacheableInterface |
||
12 | { |
||
13 | |||
14 | use CachableTrait; |
||
15 | |||
16 | public const NAME = 'oauth2_service_account'; |
||
17 | |||
18 | public const BASE_URL = 'https://www.googleapis.com/oauth2/v4/token'; |
||
19 | |||
20 | public const CACHE_NAMESPACE = 'oauth2_service_account'; |
||
21 | public const CACHE_EXPIRATION = 1800; |
||
22 | |||
23 | public const SCOPE = 'https://ddp.googleapis.com/api/ddp/'; |
||
24 | |||
25 | /** @var Cache */ |
||
26 | protected $cache; |
||
27 | |||
28 | /** @var JwtFactoryInterface */ |
||
29 | protected $jwtFactory; |
||
30 | |||
31 | /** @var ClientInterface */ |
||
32 | protected $client; |
||
33 | |||
34 | public function __construct(ClientInterface $clientInterface, Cache $cache, JwtFactoryInterface $jwtFactory) |
||
42 | |||
43 | public function authenticate(bool $cache = true): BearerToken |
||
76 | |||
77 | public function getSlug(): string |
||
81 | } |
||
82 |