Skip to content

Commit 2575c79

Browse files
committed
Allow using a custom key store
1 parent b2c0ccd commit 2575c79

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## Unreleased
4+
5+
- Allow the usage of a custom key store when using the Handler.
6+
37
## 1.4.0 - 2017-03-15
48

59
- Token verification now includes existence checks for claims (follow up to [kreait/firebase-php#70](https://github.com/kreait/firebase-php/issues/70))

src/Handler.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Firebase\Auth\Token;
44

5+
use Firebase\Auth\Token\Domain\KeyStore;
56
use Lcobucci\JWT\Token;
67

78
final class Handler implements Domain\Generator, Domain\Verifier
@@ -16,10 +17,10 @@ final class Handler implements Domain\Generator, Domain\Verifier
1617
*/
1718
private $verifier;
1819

19-
public function __construct(string $projectId, string $clientEmail, string $privateKey)
20+
public function __construct(string $projectId, string $clientEmail, string $privateKey, KeyStore $keyStore = null)
2021
{
2122
$this->generator = new Generator($clientEmail, $privateKey);
22-
$this->verifier = new Verifier($projectId);
23+
$this->verifier = new Verifier($projectId, $keyStore ?? new HttpKeyStore());
2324
}
2425

2526
public function createCustomToken($uid, array $claims = []): Token

0 commit comments

Comments
 (0)