Module: JWT::Claims
- Defined in:
- lib/jwt/claims.rb,
lib/jwt/claims/issuer.rb,
lib/jwt/claims/jwt_id.rb,
lib/jwt/claims/numeric.rb,
lib/jwt/claims/subject.rb,
lib/jwt/claims/audience.rb,
lib/jwt/claims/required.rb,
lib/jwt/claims/verifier.rb,
lib/jwt/claims/issued_at.rb,
lib/jwt/claims/expiration.rb,
lib/jwt/claims/not_before.rb,
lib/jwt/claims/decode_verifier.rb
Overview
JWT Claim verifications datatracker.ietf.org/doc/html/rfc7519#section-4
Verification is supported for the following claims: exp nbf iss iat jti aud sub required numeric
Defined Under Namespace
Modules: DecodeVerifier, Verifier Classes: Audience, Error, Expiration, IssuedAt, Issuer, JwtId, NotBefore, Numeric, Required, Subject, VerificationContext
Class Method Summary collapse
-
.payload_errors(payload, *options) ⇒ Array<JWT::Claims::Error>
Returns the errors in the claims of the JWT token.
-
.valid_payload?(payload, *options) ⇒ Boolean
Checks if the claims in the JWT payload are valid.
-
.verify!(payload, options) ⇒ Object
deprecated
Deprecated.
Use Claims.verify_payload! instead. Will be removed in the next major version of ruby-jwt.
-
.verify_payload!(payload, *options) ⇒ void
Checks if the claims in the JWT payload are valid.
Class Method Details
.payload_errors(payload, *options) ⇒ Array<JWT::Claims::Error>
Returns the errors in the claims of the JWT token.
67 68 69 |
# File 'lib/jwt/claims.rb', line 67 def payload_errors(payload, *) token_errors(VerificationContext.new(payload: payload), *) end |
.valid_payload?(payload, *options) ⇒ Boolean
Checks if the claims in the JWT payload are valid.
59 60 61 |
# File 'lib/jwt/claims.rb', line 59 def valid_payload?(payload, *) payload_errors(payload, *).empty? end |
.verify!(payload, options) ⇒ Object
Use verify_payload! instead. Will be removed in the next major version of ruby-jwt.
36 37 38 |
# File 'lib/jwt/claims.rb', line 36 def verify!(payload, ) DecodeVerifier.verify!(payload, ) end |
.verify_payload!(payload, *options) ⇒ void
This method returns an undefined value.
Checks if the claims in the JWT payload are valid.
50 51 52 |
# File 'lib/jwt/claims.rb', line 50 def verify_payload!(payload, *) verify_token!(VerificationContext.new(payload: payload), *) end |