Skip to content

@hono/oauth-providersでDiscord認証などができるか確かめたい

License

Notifications You must be signed in to change notification settings

whyk-pg/verify-hono-oauth-providers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Verify @hono/oauth-providers/discord

本リポジトリの目的

@hono/oauth-providers/discordを使ってDiscord IDによる認証基盤が作れるか確認したい

本リポジトリの達成目標

  • 環境構築
  • Discord側と疎通させる
  • 認証してユーザー情報が取得できることを確認する
  • 特定のサーバーIDをもとに認可制御を行なう

エラー解決

redirect_uriの無効

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が無効だというDiscord側のエラー画面 しかし、redirect_uriをhttps://~に書き直したところ正常な認証画面に遷移し、そこでボタンを押すとまたredirect_uriが不正だとしてエラー画面に遷移した redirect_uriが無効だというアプリ側のエラー画面

参考資料

About

@hono/oauth-providersでDiscord認証などができるか確かめたい

Resources

License

Stars

Watchers

Forks