Sha256: 8f7f9959b3871f0723f4fd872d7855b36cac724e605a185e22cb245023b0f984
Contents?: true
Size: 489 Bytes
Versions: 21
Compression:
Stored size: 489 Bytes
Contents
# frozen_string_literal: true require "jwt" module LiveKit class TokenVerifier def initialize(api_key: nil, api_secret: nil) @api_key = api_key @api_secret = api_secret end def verify(token) decoded_token = JWT.decode(token, @api_secret, true, algorithm: AccessToken::SIGNING_ALGORITHM) decoded = decoded_token.first if decoded["iss"] != @api_key raise "Invalid issuer" end ClaimGrant.from_hash(decoded) end end end
Version data entries
21 entries across 21 versions & 1 rubygems