Usage( 文法 )
toekn=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
curl https://jwt.deno.dev/$token
Example( 実行例 )
ウラル🏔( URL )
カール🐸( curl )
curl https://jwt.deno.dev/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c
ジャバスクリプト🧉( JavaScript )
await fetch('https://jwt.deno.dev/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c').then(r=>r.json())
ぴぃえぃちぴぃ🐘( PHP )
var_dump(json_decode(file_get_contents('https://jwt.deno.dev/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c')));
ぴぃてぉん🐍( Python )
import requests
requests.get('https://jwt.deno.dev/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c').json()
うびぃ💎( Ruby )
require 'net/http'
require 'json'
require 'uri'
JSON.parse(Net::HTTP.get(URI.parse('https://jwt.deno.dev/eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c')))
Output( 出力 )
[
{
"alg": "HS256",
"typ": "JWT"
},
{
"sub": "1234567890",
"name": "John Doe",
"iat": 1516239022
},
{
"0": 73,
"1": 249,
"2": 74,
"3": 199,
"4": 4,
"5": 73,
"6": 72,
"7": 199,
"8": 138,
"9": 40,
"10": 93,
"11": 144,
"12": 79,
"13": 135,
"14": 240,
"15": 164,
"16": 199,
"17": 137,
"18": 127,
"19": 126,
"20": 143,
"21": 58,
"22": 78,
"23": 178,
"24": 37,
"25": 95,
"26": 218,
"27": 117,
"28": 11,
"29": 44,
"30": 195,
"31": 151
}
]
Source code( ソースコード🍝 )
import { serve } from "https://deno.land/std@0.177.0/http/server.ts";
import { decode } from "https://deno.land/x/djwt@v2.8/mod.ts";
const options = {
headers: {
'Access-Control-Allow-Origin': '*',
'Content-Type': 'application/json'
}
}
serve((req: Request) => new Response(JSON.stringify(decode(req.url.slice(21)), null, 2), options))
ライブラリインストール面倒くさいときに、ご賞味ください
参考