class Auth0RS256JWTVerifier::JWTDecoder

Public Instance Methods

decode(jwt_str) click to toggle source
# File lib/auth0_rs256_jwt_verifier/jwt_decoder.rb, line 6
def decode(jwt_str)
  jwt = JSON::JWT.decode(jwt_str, :skip_verification)
  DecodedJWT.new(jwt)
end
signed_with?(jwt_str, public_key) click to toggle source
# File lib/auth0_rs256_jwt_verifier/jwt_decoder.rb, line 11
def signed_with?(jwt_str, public_key)
  jwt_str = String(jwt_str)
  JSON::JWT.decode(jwt_str, public_key)
  true
rescue JSON::JWS::VerificationFailed
  false
end