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
230
OAuth2.0完全に理解した
OAuth2.0完全に理解した
ryome
May 18, 2023
Tweet
Share
More Decks by ryome
See All by ryome
AWSデスノート〜AWSの嫌いなところまとめ〜
ryome
0
27
AWS MCPを使ってみた
ryome
0
570
ClineでAWS CDKやインフラ構成図作ってみた
ryome
1
570
PlaywrightというE2Eテストツールを布教したい
ryome
0
63
Cursorという最強エディタを使いこなしたい
ryome
0
310
E2Eテストを自動化したい
ryome
0
77
AWS CodeBuildを高速化したい
ryome
0
610
CDKでAppSyncのJavaScriptリゾルバを開発したい
ryome
0
290
Cognitoの複数IDP認証でユーザを統合したい
ryome
1
1.3k
Other Decks in Technology
See All in Technology
Kaggleコンペティション「MABe Challenge - Social Action Recognition in Mice」振り返り
yu4u
1
760
かわいい身体と声を持つ そういうものに私はなりたい
yoshimura_datam
0
520
3リポジトリーを2ヶ月でモノレポ化した話 / How I turned 3 repositories into a monorepo in 2 months
kubode
0
120
Regional_NAT_Gatewayについて_basicとの違い_試した内容スケールアウト_インについて_IPv6_dual_networkでの使い分けなど.pdf
cloudevcode
1
160
新規事業における「一部だけどコア」な AI精度改善の優先順位づけ
zerebom
0
320
ReproでのicebergのStreaming Writeの検証と実運用にむけた取り組み
joker1007
0
490
Azure SRE Agent x PagerDutyによる近未来インシデント対応への期待 / The Future of Incident Response: Azure SRE Agent x PagerDuty
aeonpeople
0
200
Riverpod3.xで実現する実践的UI実装
fumiyasac0921
2
340
JuliaTokaiとしてはこれが最後かもしれない(仮) for NGK2026S
antimon2
0
120
ビジュアルプログラミングIoTLT vol.22
1ftseabass
PRO
0
140
Claude Codeベストプラクティスまとめ
minorun365
49
27k
プロダクトエンジニアこそ必要なPMスキル 〜デリバリー力を最大化し、価値を届け続けるために〜
layerx
PRO
0
140
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
140
Art, The Web, and Tiny UX
lynnandtonic
304
21k
Mobile First: as difficult as doing things right
swwweet
225
10k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1k
What does AI have to do with Human Rights?
axbom
PRO
0
1.9k
Designing for Timeless Needs
cassininazir
0
120
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
120
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
370
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.7k
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