We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 385c46a commit 3674b86Copy full SHA for 3674b86
src/Utils/ReplayDetector.php
@@ -0,0 +1,24 @@
1
+<?php
2
+
3
+namespace Pdsinterop\Solid\Auth\Utils;
4
5
+use DateInterval;
6
+use Pdsinterop\Solid\Auth\ReplayDetectorInterface;
7
8
+/**
9
+ * Validates whether a provided JTI (JWT ID) is valid.
10
+ *
11
+ * @see https://datatracker.ietf.org/doc/html/draft-ietf-oauth-dpop
12
+ */
13
+class ReplayDetector implements ReplayDetectorInterface
14
+{
15
+ private $callback;
16
17
+ public function __construct($callback) {
18
+ $this->callback = $callback;
19
+ }
20
+ public function detect(string $jti, string $targetUri): bool
21
+ {
22
+ return ($this->callback)($jti, $targetUri);
23
24
+}
0 commit comments