Skip to content

Commit 7509c74

Browse files
Merge pull request #82 from Vonage/jwt
DEVX-3061 add incoming jwt decode snippet
2 parents 685b48d + 38ae8ce commit 7509c74

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

jwt/decode-incoming-jwt.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
require 'jwt'
2+
3+
SIGNATURE = ARGV[0] || ENV['SIGNATURE']
4+
5+
# The JWT Ruby spec requires nil and false values provided, respectively, for the two optional parameters
6+
# See: https://github.com/jwt/ruby-jwt#algorithms-and-usage
7+
decoded = JWT.decode(SIGNATURE, nil, false)
8+
puts decoded

0 commit comments

Comments
 (0)