Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
About_JWT_at_NDS_39_Niigata_pm
Search
ritou
December 13, 2014
Technology
560
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
About_JWT_at_NDS_39_Niigata_pm
NDS#39 Niigata.pm tech talk
http://connpass.com/event/8695/
で発表した資料です。
ritou
December 13, 2014
Transcript
47 slides
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
More Decks by ritou
See All by ritou
FAPIの立ち位置はどう変わる? ~多様化するユースケースを支えるセキュアAPIエコノミー~
ritou
1
67
“ID沼入口” - 基本とセキュリティから始める、考え続けるためのID管理技術勉強会 告知&イントロ
ritou
0
720
認証認可だけじゃない! ID管理の構成要素と ライフサイクルを意識しよう
ritou
1
960
[PR] はじめてのデジタルアイデンティティという本を書きました
ritou
2
1.5k
“パスワードレス認証への道" ユーザー認証の変遷とパスキーの関係
ritou
2
7.8k
パスキー導入の課題と ベストプラクティス、今後の展望
ritou
12
9.7k
Password-less Journey - パスキーへの移行を見据えたユーザーの準備 + α
ritou
1
210
Password-less Journey - パスキーへの移行を見据えたユーザーの準備 @ AXIES 2024
ritou
4
1.9k
OIDF-J EIWG 振り返り
ritou
2
140
Other Decks in Technology
See All in Technology
サーバーラックは作る時代! 3Dプリンターで作る10インチラックのススメ
jacopen
2
490
PHPで家庭用ゲーム機の専用コントローラーをMIDIデバイスとして扱ってみる
wind111
0
170
AWS Blocksで AIエージェント作れるの知ってます?
kmiya84377
1
130
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
Platform Engineering をベースとした Agentic Software Factory の実践
110y
1
430
市販IoT機器や自作IoT機器とHomeAssistantを駆使して家の電気代をできる限り見える化する方法の考案
harutiro
0
400
高品質と高スピードを支える品質のシフトレフトのアプローチ
goyoki
4
1.7k
AWS DevOps Agentの構造から読み解く運用 AI エージェントの設計原則/aws-devops-agent-design-principles
tomoki10
0
140
cdkdがどんだけ早いか、実際に動かして見てみよう
smt7174
1
140
Agent Routerで作るマルチテナント 推論基盤 #CNDW2026 / Building Multi-Tenant Inference Platform with Agent Router #CNDW2026
everpeace
4
510
落とし穴にハマってわかった 開発生産性を測るときに気をつけたいこと
munakata
3
460
OWASP AI Agentic Top10に準拠するクラウドネイティブなガードレールの実践(CNDW 2026)
keitah
1
370
Featured
See All Featured
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
840
The untapped power of vector embeddings
frankvandijk
2
2k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
1.1k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
550
Building Applications with DynamoDB
mza
96
7.3k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
Fireside Chat
paigeccino
43
4.1k
Everyday Curiosity
cassininazir
0
410
Balancing Empowerment & Direction
lara
6
1.4k
The Art of Programming - Codeland 2020
erikaheidi
57
15k