@hono/oauth-providers/discord
を使ってDiscord IDによる認証基盤が作れるか確認したい
- 環境構築
- Discord側と疎通させる
- 認証してユーザー情報が取得できることを確認する
- 特定のサーバーIDをもとに認可制御を行なう
https://502f-175-132-206-78.ngrok-free.app/auth/discord というURLでDiscord認証を試したところ、以下のURLになった
https://discord.com/oauth2/authorize?response_type=code&client_id=xxx&scope=identify+email+guilds&state=xxxx&prompt=consent&redirect_uri=http%3A%2F%2F502f-175-132-206-78.ngrok-free.app%2Fauth%2Fdiscord
その結果、redirect_uri
が無効だと判定された
しかし、redirect_uriをhttps://~
に書き直したところ正常な認証画面に遷移し、そこでボタンを押すとまたredirect_uri
が不正だとしてエラー画面に遷移した