Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Firebase Auth Emulator interferes with Firebase Storage

未關閉
#769 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
java

研究方向

先閱讀 src/main/java/com/google/firebase/auth/internal/Utils.java 和 src/main/java/com/google/firebase/ImplFirebaseTrampolines.java,尤其關注 FIREBASE_AUTH_EMULATOR_HOST 和模擬器憑證的處理。在同時啟用 Auth 和 Storage 的情況下重現問題,然後驗證 Storage 呼叫仍保持授權狀態,而模擬器憑證僅套用於 Auth;另外也檢查不同的 FirebaseApp 執行個體是否可以使用不同的模擬器設定。

由索引模型根據 Issue 內容生成。

描述

api: auth
[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
    with the firebase tag.
  • For general Firebase discussion, use the 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.
[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 and uses emulator credentials. 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.

主要語言
Java
星號
620
分支
305
平均合併
4 天 9 小時
30 天內合併 PR
4

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

firebase/firebase-admin-java 的其他 Issue

查看 firebase/firebase-admin-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。