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 7dcea42 commit 2ec1fadCopy full SHA for 2ec1fad
1 file changed
lib/src/main/java/com/auth0/jwt/ExtendedJWT.java
@@ -0,0 +1,43 @@
1
+package com.auth0.jwt;
2
+
3
+import com.auth0.jwt.algorithms.Algorithm;
4
+import com.auth0.jwt.interfaces.GoogleVerification;
5
+import com.auth0.jwt.interfaces.Verification;
6
7
+import java.util.Date;
8
+import java.util.List;
9
10
+public class ExtendedJWT extends GoogleJWT implements GoogleVerification{
11
12
+ ExtendedJWT(Algorithm algorithm) throws IllegalArgumentException {
13
+ super(algorithm);
14
+ }
15
16
17
+ public Verification createVerifierForExtended(String picture, String email, List<String> issuer,
18
+ List<String> audience, String name, long nbf, long expLeeway, long iatLeeway) {
19
+ Verification verification = createVerifierForGoogle(picture, email, issuer, audience, name, expLeeway, iatLeeway);
20
+ return verification.withNbf(nbf);
21
22
23
+ public static GoogleVerification require(Algorithm algorithm) {
24
+ return ExtendedJWT.init(algorithm);
25
26
27
+ static GoogleVerification init(Algorithm algorithm) throws IllegalArgumentException {
28
+ return new ExtendedJWT(algorithm);
29
30
31
+ /**
32
+ * Require a specific Not Before ("nbf") claim.
33
+ *
34
+ * @param nbf the required Not Before value
35
+ * @return this same Verification instance.
36
+ */
37
+ @Override
38
+ public Verification withNbf(long nbf) {
39
+ requireClaim("nbf", nbf);
40
+ return this;
41
42
43
+}
0 commit comments