1 | <?php |
||
12 | class JwtStrategy implements AuthStrategyInterface |
||
13 | { |
||
14 | |||
15 | const NAME = 'jwt_auth_strategy'; |
||
16 | |||
17 | const BASE_URL = 'https://ims-na1.adobelogin.com/ims/exchange/jwt/'; |
||
18 | |||
19 | const CACHE_NAMESPACE = 'jwt_auth_token'; |
||
20 | const TOKEN_EXPIRATION = 110; |
||
21 | |||
22 | /** @var Cache */ |
||
23 | protected $cache; |
||
24 | |||
25 | /** |
||
26 | * JwtStrategy constructor. |
||
27 | * |
||
28 | * @param ClientInterface $clientInterface |
||
29 | * @param Cache|null $cache |
||
30 | */ |
||
31 | public function __construct(ClientInterface $clientInterface, Cache $cache) |
||
36 | |||
37 | public function authenticate($clientId, $secretKey, $username, $password, $cache = true, $refresh = false) |
||
41 | |||
42 | public function authenticateJwtToken($clientId, $secretKey, $jwtToken, $cache = true) |
||
83 | |||
84 | /** |
||
85 | * @return string |
||
86 | */ |
||
87 | public function getSlug() |
||
91 | } |
||
92 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: