0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

NextAuthでGoogleログインを実装する

前回の記事でNextAuthのセットアップは完了しました
今回はGoogleログインの実行方法について解説します

アクセスし、プロジェクトの作成を行う
同意画面の作成を行う
ログイン時に出てくる画面のことを指す

Usertypeを外部

他はプロジェクトに合わせるだけ

認証に戻り、認証情報の作成→OAuthクライアントの作成に進む

「承認済みの JavaScript 生成元」にhttp://localhost:3000を入力します。
「承認済みのリダクレイト URI」にhttp://localhost:3000/api/auth/callback/googleを入力します。

他はプロジェクトに合わせる

この後に出てくるクライアント ID」と「クライアントシークレット」は必ずコピーする

.env
GOOGLE_CLIENT_ID=''
GOOGLE_CLIENT_SECRET=''

にペーストする

コレによりGoogleログインが実装される

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?