1 | <?php |
||
15 | * @link http://tools.ietf.org/html/draft-jones-oauth-jwt-bearer-04 |
||
16 | */ |
||
17 | class JwtBearer extends GrantTypeBase |
||
18 | { |
||
19 | const CONFIG_PRIVATE_KEY = 'private_key'; |
||
20 | |||
21 | protected $grantType = 'urn:ietf:params:oauth:grant-type:jwt-bearer'; |
||
22 | |||
23 | /** |
||
24 | * @param ClientInterface $client |
||
25 | * @param array $config |
||
26 | */ |
||
27 | 4 | public function __construct(ClientInterface $client, array $config = []) |
|
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | 4 | protected function getRequired() |
|
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | 1 | protected function getAdditionalOptions() |
|
55 | |||
56 | /** |
||
57 | * Compute JWT, signing with provided private key. |
||
58 | * |
||
59 | * @return string |
||
60 | */ |
||
61 | 1 | protected function computeJwt() |
|
74 | |||
75 | /** |
||
76 | * Read private key. |
||
77 | * |
||
78 | * @param SplFileObject $privateKey |
||
79 | * |
||
80 | * @return string |
||
81 | */ |
||
82 | 1 | protected function readPrivateKey(SplFileObject $privateKey) |
|
83 | { |
||
92 |