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
OAuth2.0完全に理解した
Search
ryome
May 18, 2023
Technology
0
170
OAuth2.0完全に理解した
OAuth2.0完全に理解した
ryome
May 18, 2023
Tweet
Share
More Decks by ryome
See All by ryome
AWS MCPを使ってみた
ryome
0
180
ClineでAWS CDKやインフラ構成図作ってみた
ryome
1
420
PlaywrightというE2Eテストツールを布教したい
ryome
0
50
Cursorという最強エディタを使いこなしたい
ryome
0
260
E2Eテストを自動化したい
ryome
0
68
AWS CodeBuildを高速化したい
ryome
0
460
CDKでAppSyncのJavaScriptリゾルバを開発したい
ryome
0
270
Cognitoの複数IDP認証でユーザを統合したい
ryome
0
1.1k
Amazon_CodeWhispererで生産性を爆上げする
ryome
0
70
Other Decks in Technology
See All in Technology
活きてなかったデータを活かしてみた話 / Shirokane Kougyou vol 19
sansan_randd
1
230
今からでも間に合う! 生成AI「RAG」再入門 / Re-introduction to RAG in Generative AI
hideakiaoyagi
1
160
成立するElixirの再束縛(再代入)可という選択
kubell_hr
0
150
RubyOnRailsOnDevin+α / DevinMeetupJapan#2
ginkouno
0
190
Tenstorrent 開発者プログラム
tenstorrent_japan
0
300
Workflows から Agents へ ~ 生成 AI アプリの成長過程とアプローチ~
belongadmin
2
140
Introduction to Bill One Development Engineer
sansan33
PRO
0
250
産業機械をElixirで制御する
kikuyuta
0
160
Nonaka Sensei
kawaguti
PRO
3
610
開発効率と信頼性を両立する Ubieのプラットフォームエンジニアリング
teru0x1
0
130
「規約、知識、オペレーション」から考える中規模以上の開発組織のCursorルールの 考え方・育て方 / Cursor Rules for Coding Styles, Domain Knowledges and Operations
yuitosato
6
1.6k
Eight Engineering Unit 紹介資料
sansan33
PRO
0
3.4k
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
106
19k
BBQ
matthewcrist
89
9.7k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
29
9.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
6
690
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
31
1.2k
Product Roadmaps are Hard
iamctodd
PRO
53
11k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
2.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
Unsuck your backbone
ammeep
671
58k
Docker and Python
trallard
44
3.4k
Transcript
OAuth 2.0 完全に理解した。
OAuth 2.0とは? OAuth(オー・オース) は、Open Authorization の略。 OAuth 2.0 は、異なる2つのサービス間でユーザー情報などの リソースを共有することを可能にする、ユーザー権限の認可をおこ
なうためのスタンダードです。 ユーザーがユーザー名(IDやメールアドレス等)とパスワードをク ライアントに提供することなく、ユーザ情報の開示ができることが メリット。
OAuth 1.0とOAuth 2.0の違い • OAuth 1.0では、署名プロセスのみの認証しかサポートしていな い。 • OAuth 2.0は、より多くの認証フローをサポートしている。
(認証コードフロー、暗黙のフロー、リソース所有者パスワー ド資格情報フロー、クライアント資格情報フローなど)
OAuth 2.0のインフラ構成図
OAuth 2.0のシーケンス図 今回のサンプルは 認証コードフロー
今回作ったアプリのUI 詳しくはこちら↓ https://github.com/ryomeblog/google-oauth
環境構築説明 プロジェクト作成 • GCP: https://console.cloud.google.com/welcome
環境構築説明 クライアントIDとクライアントシークレット発行
環境構築説明 バックエンド(Lambda)デプロイ
環境構築説明 Reactアプリ起動
react-google-loginに悩まされる • 認証が通っても「popup_closed_by_user」エラーになるバグがあります。 • 2017年から直ってません。 • 「@react-oauth/google」を使いましょう。 詳しくはこちら↓ https://github.com/anthonyjgrove/react-google-login/issues/132
GitHub 今回解説した「 OAuth 2.0 」のサンプルコードは GitHubに格納しています。 GitHub URL https://github.com/ryomeblog/google-oauth
参考文献 • https://github.com/ryomeblog/google-oauth • https://github.com/anthonyjgrove/react-google- login/issues/132 • https://developers.google.com/identity/protocols/oauth 2?hl=ja