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,
lib/json_web_token/algorithm/rsa_util.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.3.3"
Class Method Summary collapse
-
.sign(claims, options) ⇒ String
A JSON Web Token, representing digitally signed claims.
-
.verify(jwt, options) ⇒ Hash
{ok: < the jwt claims set hash >} 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 {ok: < the jwt claims set hash >} if the jwt verifies, or {error: ‘Invalid’} otherwise.
30 31 32 |
# File 'lib/json_web_token.rb', line 30 def verify(jwt, ) Jwt.verify(jwt, ) end |