module JWT
JSON Web Token implementation
Should be up to date with the latest spec: tools.ietf.org/html/rfc7519
JWT::Decode module
JWT::Encode module
JWT::Signature module
Moments version builder module
Constants
- DecodeError
- EncodeError
- ExpiredSignature
- ImmatureSignature
- IncorrectAlgorithm
- InvalidAudError
- InvalidIatError
- InvalidIssuerError
- InvalidJtiError
- InvalidPayload
- InvalidSubError
- JWKError
- RequiredDependencyError
- VerificationError
Public Class Methods
gem_version()
click to toggle source
# File lib/jwt/version.rb, line 4 def self.gem_version Gem::Version.new VERSION::STRING end
Public Instance Methods
decode(jwt, key = nil, verify = true, options = {}, &keyfinder)
click to toggle source
# File lib/jwt.rb, line 26 def decode(jwt, key = nil, verify = true, options = {}, &keyfinder) Decode.new(jwt, key, verify, DEFAULT_OPTIONS.merge(options), &keyfinder).decode_segments end
encode(payload, key, algorithm = 'HS256', header_fields = {})
click to toggle source
# File lib/jwt.rb, line 19 def encode(payload, key, algorithm = 'HS256', header_fields = {}) Encode.new(payload: payload, key: key, algorithm: algorithm, headers: header_fields).segments end