![【技術メモ】This domain(127.0.0.1)is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab. Dismissが表示された時の解決方法](https://itechsearchengine.com/wp-content/uploads/2021/07/01f0406ee5ce1108b426d000487f42f4.png)
Firebaseを使ってソーシャルログインを作ろうと思い、実装していたところ当然の如くエラーが発生しました!
![](https://itechsearchengine.com/wp-content/uploads/2020/09/42f9cab910351fa8045b20f76d340390.png)
こめつぶ
新しいことをやると必ずエラーって出ますよね。。。
実際のエラー画面
![](https://itechsearchengine.com/wp-content/uploads/2021/07/1bd1edcd70ce4e119c5d413b4de8af52-1.png)
This domain(127.0.0.1)is not authorized to run this operation. Add it to the OAuth redirect domains list in the Firebase console -> Auth section -> Sign in method tab. Dismiss
私はローカル環境で試していたところ上記のエラーが発生しました。
domain()の中身は私の場合、127.0.0.1になっていますが、試しているdomainの場所によって値が変わると思います。
修正方法
①「Authentication」を選択し、「承認済みドメイン」を確認します。
![](https://itechsearchengine.com/wp-content/uploads/2021/07/0a75ddfaeb4a1004d8db4b418d8f515a-1024x452.png)
②「ドメインを追加」を選択します。
![](https://itechsearchengine.com/wp-content/uploads/2021/07/e29e10c69f0b9e2d2427bd0c130b4b24-1024x470.png)
③エラーで表示されていたドメイン(IPアドレス)を入力し、「追加」を押します。
私の場合、「127.0.0.1」と表示されていました。
![](https://itechsearchengine.com/wp-content/uploads/2021/07/d331a448ce55b1e4a51b6187a165b66b-1024x471.png)
④Webページを更新して、「Sign in with Google」を選択します。
![](https://itechsearchengine.com/wp-content/uploads/2021/07/d4360014a29368d2bde195f87747cf33-1.png)
⑤グーグルアカウントを選択する。
![](https://itechsearchengine.com/wp-content/uploads/2021/07/1468445d8bbc743463e6075106b84a17-1-784x1024.png)
![](https://itechsearchengine.com/wp-content/uploads/2020/09/42f9cab910351fa8045b20f76d340390.png)
こめつぶ
エラーが発生せずに、グーグルアカウントを選択できる画面が表示されました!
⑥ログイン成功確認する
![](https://itechsearchengine.com/wp-content/uploads/2021/07/3b063dc0af9a8a69673e2efadee08ea2-1-1024x152.png)
終わりに
今回はソーシャルログインを試しに作ろうと思ったときに、発生したエラーでした。
同じようなエラーで悩んでいる方の解決案になれば幸いです。
私はエラーが出たら、一回深呼吸をして心を落ち着かせるようにしています。
皆さんのエラーが出たときの初動を教えて欲しいです!
![](https://itechsearchengine.com/wp-content/uploads/2020/09/42f9cab910351fa8045b20f76d340390.png)
こめつぶ
エラーが出たときの対応をコメントで教えてください!
【技術メモ】Firebaseのプロジェクトを作成する方法