firebase / firebase/firebase-admin-java

Firebase Auth Emulator interferes with Firebase Storage

オープン
#769 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
api: auth
主要言語
Java
スター
620
フォーク
305
平均マージ
3時間 23分
マージ済み PR(30日)
1

説明

### [READ] Step 1: Are you in the right place?

* For issues or feature requests related to __the code in this repository__
file a Github issue.
* If this is a __feature request__ make sure the issue title starts with "FR:".
* For general technical questions, post a question on [StackOverflow](http://stackoverflow.com/)
with the firebase tag.
* For general Firebase discussion, use the [firebase-talk](https://groups.google.com/forum/#!forum/firebase-talk)
google group.
* For help troubleshooting your application that does not fall under one
of the above categories, reach out to the personalized
[Firebase support channel](https://firebase.google.com/support/).

### [REQUIRED] Step 2: Describe your environment

* Operating System version: Windows 11
* Firebase SDK version: ____
* Library version: 9.1.1
* Firebase Product: auth, storage

### [REQUIRED] Step 3: Describe the problem

We access the Auth and Storage services in our project using this Java Admin SDK.
Recently, we wanted to make use of the Auth Emulator for development purposes. However, after enabling the emulator by setting the `FIREBASE_AUTH_EMULATOR_HOST` environment variable, the Storage calls stop working and return 401 Unauthorized.

It seems that by setting the `FIREBASE_AUTH_EMULATOR_HOST` environment variable, the [whole project enters an emulator mode](https://github.com/firebase/firebase-admin-java/blob/e8ec68c97929972acdbe05b79b5ea18f077a08a2/src/main/java/com/google/firebase/auth/internal/Utils.java#L27) and [uses emulator credentials](https://github.com/firebase/firebase-admin-java/blob/master/src/main/java/com/google/firebase/ImplFirebaseTrampolines.java#L47). The emulator credentials should be made to only apply to Auth calls.

Furthermore, I could not even find a way to create two instances of FirebaseApps (one with the emulator enabled and one disabled), since the check for `FIREBASE_AUTH_EMULATOR_HOST` is static and shared program-wide.

#### Steps to reproduce:

Use Auth and Storage in a production project. Enable `FIREBASE_AUTH_EMULATOR_HOST` and Storage stops working.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start by reading src/main/java/com/google/firebase/auth/internal/Utils.java and src/main/java/com/google/firebase/ImplFirebaseTrampolines.java, especially the FIREBASE_AUTH_EMULATOR_HOST and emulator-credential handling. Reproduce the issue with Auth and Storage enabled together, then verify that Storage calls remain authorized while emulator credentials apply only to Auth; also check whether separate FirebaseApp instances can differ in emulator configuration.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
java
領域
authentication, backend
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。