Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
About_JWT_at_NDS_39_Niigata_pm
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
ritou
December 13, 2014
Technology
530
2
Share
About_JWT_at_NDS_39_Niigata_pm
NDS#39 Niigata.pm tech talk
http://connpass.com/event/8695/
で発表した資料です。
ritou
December 13, 2014
More Decks by ritou
See All by ritou
[PR] はじめてのデジタルアイデンティティという本を書きました
ritou
2
1.2k
“パスワードレス認証への道" ユーザー認証の変遷とパスキーの関係
ritou
2
6.7k
パスキー導入の課題と ベストプラクティス、今後の展望
ritou
12
7.7k
Password-less Journey - パスキーへの移行を見据えたユーザーの準備 + α
ritou
1
170
Password-less Journey - パスキーへの移行を見据えたユーザーの準備 @ AXIES 2024
ritou
4
1.8k
OIDF-J EIWG 振り返り
ritou
2
100
そのQRコード、安全ですか? / Cross Device Flow
ritou
4
660
MIXI Mと社内外のサービスを支える認証基盤を作るためにやってきたこと #MTDC2024
ritou
3
800
Passkeys and Identity Federation @ OpenID Summit Tokyo 2024
ritou
2
1k
Other Decks in Technology
See All in Technology
Discordでリモートポケカしてたら、なぜかDOを25分間動かせるようになった話
umireon
0
120
AIを活用したアクセシビリティ改善フロー
degudegu2510
1
170
Eight Engineering Unit 紹介資料
sansan33
PRO
3
7.2k
Proxmox超入門
devops_vtj
0
170
OBI+APMでお手軽にアプリケーションのオブザーバビリティを手に入れよう
kenshimuto
0
200
さくらのクラウドでつくるCloudNative Daysのオブザーバビリティ基盤
b1gb4by
0
150
Autonomous Database - Dedicated 技術詳細 / adb-d_technical_detail_jp
oracle4engineer
PRO
5
13k
申請待ちゼロへ!AWS × Entra IDで実現した「権限付与」のセルフサービス化
mhrtech
1
280
数案件を同時に進行するためのコンテキスト整理術
sutetotanuki
1
190
ふりかえりを 「あそび」にしたら、 学習が勝手に進んだ / Playful Retros Drive Learning
katoaz
0
450
生成AI時代のエンジニア育成 変わる時代と変わらないコト
starfish719
0
580
20260410 - CNTUG meetup #72 - DiskImage Builder 介紹:以 Kubespray CI 打造 RockyLinux 10 Cloud Image 為例
tico88612
0
120
Featured
See All Featured
Marketing to machines
jonoalderson
1
5.1k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
330
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
89
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
190
How to Ace a Technical Interview
jacobian
281
24k
What's in a price? How to price your products and services
michaelherold
247
13k
Mobile First: as difficult as doing things right
swwweet
225
10k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
249
1.3M
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.7k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
220
Balancing Empowerment & Direction
lara
5
1k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.8k
Transcript
1
• • • • 2
3
4
• • • • • 5
6
eyJ .eyJ . 7
[Encoded Header] [Encoded Payload] [Encoded Signature] 8
{"alg":"HS256","typ":"JWT"} 9
{"name":"ritou","title":"About JSON Web Token","date":"2014-12-13"} 10
“Encoded Header + ‘.’ + Encoded Payload” eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoicml0b 3UiLCJ0aXRsZSI6IkFib3V0IEpTT04gV2ViIFRva2VuIiwiZGF0ZSI6I jIwMTQtMTItMTMifQ
11
12
13
14
• JWS(JSON Web Signature) : 署名つき • • JWA(JSON Web
Algorithm) : 署名生成/暗号化の アルゴリズム • JWK(JSON Web Key) : 鍵まわり 15
16
• • • • • • 17
18
19
20
• 21
iss [ID Tokenの発行元] sub [ユーザーID] aud [ID Tokenの発行先] 22
• • • 23
24
25
26
• • • • 27
$options->{id} はセッションID(ランダムな文字列) $options->{id} $options->{id} 28
my $cookie = crush_cookie($env->{HTTP_COOKIE} || '')->{$self- >{cookie_name}}; my $session =
$self->{store}->get($cookie) or return; $session = $self->{serializer}->[1]->($session) if $self->{serializer}; 29
• • Session IDを含むJWS • • JWS検証後 30
::JWSCookie $options->{id} はセッションID(ランダムな文字列) my $jws = encode_jwt({ id => $options->{id}
}, $self->secret, $self->alg); $jws $jws 31
::JWSCookie my $cookie = crush_cookie($env->{HTTP_COOKIE} || '')->{$self->{cookie_name}}; # JWSの検証 $payload
= decode_jwt($cookie, $self->secret, 0); 32
::JWSCookie my $id = $payload->{id}; my $session = $self->{store}->get($id) or
return; 33
• • • • 34
35
http://d.hatena.ne.jp/ritou/20140927/1411811648 36
• • • 37
38
• • • • • 39
40
• • • • • 41
42
• • • 43
44
• • • 45
• • • 46
47