Module: JsonWebToken
- Defined in:
- lib/json_web_token.rb,
lib/json_web_token/jwa.rb,
lib/json_web_token/jws.rb,
lib/json_web_token/jwt.rb,
lib/json_web_token/util.rb,
lib/json_web_token/version.rb,
lib/json_web_token/format/asn1.rb,
lib/json_web_token/algorithm/rsa.rb,
lib/json_web_token/algorithm/hmac.rb,
lib/json_web_token/algorithm/ecdsa.rb,
lib/json_web_token/algorithm/common.rb,
lib/json_web_token/format/base64_url.rb
Overview
Top level interface, or API, to sign and verify a JSON Web Token (JWT)
Defined Under Namespace
Modules: Algorithm, Format, Jwa, Jws, Jwt, Util
Constant Summary collapse
- VERSION =
'0.2.1'
Class Method Summary collapse
-
.sign(claims, options) ⇒ String
A JSON Web Token, representing digitally signed claims.
-
.verify(jwt, options) ⇒ Hash
A JWT claims set if the jwt verifies, or error: ‘Invalid’ otherwise.
Class Method Details
.sign(claims, options) ⇒ String
Returns a JSON Web Token, representing digitally signed claims.
17 18 19 |
# File 'lib/json_web_token.rb', line 17 def sign(claims, ) Jwt.sign(claims, ) end |
.verify(jwt, options) ⇒ Hash
Returns a JWT claims set if the jwt verifies, or error: ‘Invalid’ otherwise.
29 30 31 |
# File 'lib/json_web_token.rb', line 29 def verify(jwt, ) Jwt.verify(jwt, ) end |