/** * Require a specific Audience ("aud") claim. * * @param audience the required Audience value * @return this same Verification instance. */ @Override public Verification withAudience(String... audience) { requireClaim(PublicClaims.AUDIENCE, Arrays.asList(audience)); return this; }
/** * Require a specific Audience ("aud") claim. * * @param audience the required Audience value * @return this same Verification instance. */ @Override public Verification withAudience(String... audience) { requireClaim(PublicClaims.AUDIENCE, Arrays.asList(audience)); return this; }
/** * Require a specific Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Verification instance. * @throws IllegalArgumentException if the name is null. */ @Override public Verification withClaim(String name, String value) throws IllegalArgumentException { assertNonNull(name); requireClaim(name, value); return this; }
/** * Require a specific JWT Id ("jti") claim. * * @param jwtId the required Id value * @return this same Verification instance. */ @Override public Verification withJWTId(String jwtId) { requireClaim(PublicClaims.JWT_ID, jwtId); return this; }
/** * Require a specific Subject ("sub") claim. * * @param subject the required Subject value * @return this same Verification instance. */ @Override public Verification withSubject(String subject) { requireClaim(PublicClaims.SUBJECT, subject); return this; }
/** * Require a specific Issuer ("iss") claim. * * @param issuer the required Issuer value * @return this same Verification instance. */ @Override public Verification withIssuer(String issuer) { requireClaim(PublicClaims.ISSUER, issuer); return this; }
/** * Require a specific Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Verification instance. * @throws IllegalArgumentException if the name is null. */ @Override public Verification withClaim(String name, String value) throws IllegalArgumentException { assertNonNull(name); requireClaim(name, value); return this; }
/** * Require a specific Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Verification instance. * @throws IllegalArgumentException if the name is null. */ @Override public Verification withClaim(String name, Long value) throws IllegalArgumentException { assertNonNull(name); requireClaim(name, value); return this; }
/** * Require a specific Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Verification instance. * @throws IllegalArgumentException if the name is null. */ @Override public Verification withClaim(String name, Integer value) throws IllegalArgumentException { assertNonNull(name); requireClaim(name, value); return this; }
/** * Set a specific leeway window in seconds in which the Issued At ("iat") Claim will still be valid. * Issued At Date is always verified when the value is present. This method overrides the value set with acceptLeeway * * @param leeway the window in seconds in which the Issued At Claim will still be valid. * @return this same Verification instance. * @throws IllegalArgumentException if leeway is negative. */ @Override public Verification acceptIssuedAt(long leeway) throws IllegalArgumentException { assertPositive(leeway); requireClaim(PublicClaims.ISSUED_AT, leeway); return this; }
/** * Require a specific Array Claim to contain at least the given items. * * @param name the Claim's name. * @param items the items the Claim must contain. * @return this same Verification instance. * @throws IllegalArgumentException if the name is null. */ @Override public Verification withArrayClaim(String name, Integer... items) throws IllegalArgumentException { assertNonNull(name); requireClaim(name, items); return this; }
/** * Require a specific Array Claim to contain at least the given items. * * @param name the Claim's name. * @param items the items the Claim must contain. * @return this same Verification instance. * @throws IllegalArgumentException if the name is null. */ @Override public Verification withArrayClaim(String name, String... items) throws IllegalArgumentException { assertNonNull(name); requireClaim(name, items); return this; }
/** * Require a specific Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Verification instance. * @throws IllegalArgumentException if the name is null. */ @Override public Verification withClaim(String name, Boolean value) throws IllegalArgumentException { assertNonNull(name); requireClaim(name, value); return this; }
/** * Require a specific Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Verification instance. * @throws IllegalArgumentException if the name is null. */ @Override public Verification withClaim(String name, Date value) throws IllegalArgumentException { assertNonNull(name); requireClaim(name, value); return this; }
/** * Require a specific Claim value. * * @param name the Claim's name. * @param value the Claim's value. * @return this same Verification instance. * @throws IllegalArgumentException if the name is null. */ @Override public Verification withClaim(String name, Double value) throws IllegalArgumentException { assertNonNull(name); requireClaim(name, value); return this; }
/** * Set a specific leeway window in seconds in which the Not Before ("nbf") Claim will still be valid. * Not Before Date is always verified when the value is present. This method overrides the value set with acceptLeeway * * @param leeway the window in seconds in which the Not Before Claim will still be valid. * @return this same Verification instance. * @throws IllegalArgumentException if leeway is negative. */ @Override public Verification acceptNotBefore(long leeway) throws IllegalArgumentException { assertPositive(leeway); requireClaim(PublicClaims.NOT_BEFORE, leeway); return this; }
/** * Set a specific leeway window in seconds in which the Expires At ("exp") Claim will still be valid. * Expiration Date is always verified when the value is present. This method overrides the value set with acceptLeeway * * @param leeway the window in seconds in which the Expires At Claim will still be valid. * @return this same Verification instance. * @throws IllegalArgumentException if leeway is negative. */ @Override public Verification acceptExpiresAt(long leeway) throws IllegalArgumentException { assertPositive(leeway); requireClaim(PublicClaims.EXPIRES_AT, leeway); return this; }
/** * Require a specific JWT Id ("jti") claim. * * @param jwtId the required Id value * @return this same Verification instance. */ @Override public Verification withJWTId(String jwtId) { requireClaim(PublicClaims.JWT_ID, jwtId); return this; }
/** * Require a specific Subject ("sub") claim. * * @param subject the required Subject value * @return this same Verification instance. */ @Override public Verification withSubject(String subject) { requireClaim(PublicClaims.SUBJECT, subject); return this; }
/** * Require a specific Issuer ("iss") claim. * * @param issuer the required Issuer value * @return this same Verification instance. */ @Override public Verification withIssuer(String issuer) { requireClaim(PublicClaims.ISSUER, issuer); return this; }