# AI studio app builder with Firebase Authentication authorized domain error

**URL:** <https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517>\
**Category:** Google AI Studio\
**Tags:** ai-studio\
**Created:** [June 29, 2025, 3:00pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517 "2025-06-29T15:00:55Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parag\_Patil](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/parag_patil/32/57346_2.png) [@Parag\_Patil](https://discuss.ai.google.dev/u/Parag_Patil)\
**Post date:** [June 29, 2025, 3:00pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/1 "2025-06-29T15:00:55Z")

</div>

Hi All  
I’m building an app with AI studio. I’m trying to leverage firebase authentication but during preview I keep getting “Firebase: Error (auth/unauthorized-domain)” error. I’ve added multiple domain in authorised domain list but still the error persists. Any idea how to solve this?  
Authorized domains:  
“google\_com”, “aistudio\_google\_com”,“googleusercontent\_com”  
xxx.scf\_usercontent\_goog

Using underscore to bypass 2 link rule of the forum.

---

<div class="post-metadata">

**Author:** ![Dinesh\_Kumar79](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/dinesh_kumar79/32/32206_2.png) [@Dinesh\_Kumar79](https://discuss.ai.google.dev/u/Dinesh_Kumar79)\
**Post date:** [July 3, 2025, 11:35am UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/3 "2025-07-03T11:35:56Z")

</div>

hi @Parag_Patil ,  
You are seeing the “auth/unauthorized-domain” error because your AI Studio app’s domain is not correctly added to Firebase’s Authorized Domains list. Go to your Firebase Console → Authentication → Settings → add the exact full domain shown in the error.  
[Firebase Auth Domain Docs](https://firebase.google.com/docs/auth/web/redirect-best-practices#authorized-domains)  
Thanks!

---

<div class="post-metadata">

**Author:** ![Francois\_CN](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/francois_cn/32/60986_2.png) [@Francois\_CN](https://discuss.ai.google.dev/u/Francois_CN)\
**Post date:** [August 15, 2025, 10:03am UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/5 "2025-08-15T10:03:55Z")

</div>

Did you find a solution? The given answer here is not satisfactory. I have tried debugging and identified the domain used by the app run inside ai studio, but it wont work.

It looks like this.  
[https://xxxxxxxxxxxxxxxxxxx.scf.usercontent.goog](https://xxxxxxxxxxxxxxxxxxx.scf.usercontent.goog)

I tried the full url but also  
scf.usercontent.goog  
usercontent.goog

---

<div class="post-metadata">

**Author:** ![peinan](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/peinan/32/61976_2.png) [@peinan](https://discuss.ai.google.dev/u/peinan)\
**Post date:** [August 26, 2025, 3:29pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/7 "2025-08-26T15:29:11Z")

</div>

I’m having the same problem. It worked after deploying to Cloud Run and registering the domain with Firebase. But I don’t know what to do inside of AI Studio.

---

<div class="post-metadata">

**Author:** ![Vittal\_Premachandran](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/vittal_premachandran/32/35778_2.png) [@Vittal\_Premachandran](https://discuss.ai.google.dev/u/Vittal_Premachandran)\
**Post date:** [September 29, 2025, 12:43am UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/9 "2025-09-29T00:43:15Z")

</div>

@peinan I don’t see the sign in page even after deploying to cloud run. What did you end up doing?

---

<div class="post-metadata">

**Author:** ![Cam](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/cam/32/69077_2.png) [@Cam](https://discuss.ai.google.dev/u/Cam)\
**Post date:** [October 24, 2025, 5:09am UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/11 "2025-10-24T05:09:34Z")

</div>

I had the same problem. I had to delete the localhost from the domain list. I do not know why, but it fixed the problem.

---

<div class="post-metadata">

**Author:** ![founderscale](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/founderscale/32/71561_2.png) [@founderscale](https://discuss.ai.google.dev/u/founderscale)\
**Post date:** [November 12, 2025, 1:25pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/13 "2025-11-12T13:25:05Z")

</div>

Has anyone found a solution to this? I tried deleting localhost but that didn’t work for me.

---

<div class="post-metadata">

**Author:** ![paulvancotthem](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/paulvancotthem/32/66774_2.png) [@paulvancotthem](https://discuss.ai.google.dev/u/paulvancotthem)\
**Post date:** [November 13, 2025, 7:03am UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/15 "2025-11-13T07:03:19Z")

</div>

Google AI Studio support is directing us to Firebase support, while Firebase support is telling us to contact Google AI Support, creating a bit of a loop.

I reached out to Firebase Support and received a general response, but nothing concrete on how to add Firebase authentication within apps in the Google AI Studio environment. I think we also need help from the Google AI Studio support team on this, as Firebase support hasn’t provided enough detail to resolve our questions about Firebase authentication and Firestore integration.

---

<div class="post-metadata">

**Author:** ![Erkana](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/erkana/32/73176_2.png) [@Erkana](https://discuss.ai.google.dev/u/Erkana)\
**Post date:** [November 22, 2025, 4:33pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/17 "2025-11-22T16:33:45Z")

</div>

I had the same issue, and the fix for me was to capture the exact `window.location.origin` and add that full URL to the **Authorized Domains** list in Firebase Console.

Here’s the snippet I used:

```auto
// Capture the full origin to ensure accuracy
const origin = window.location.origin;
const host = window.location.host;

// We usually display the host, but keeping the origin helps show full context
setCurrentUrl(host || origin || "Unable to detect URL");

```

Once I identified the correct origin and added it to Firebase, the `auth/unauthorized-domain` error disappeared.

---

<div class="post-metadata">

**Author:** ![paulvancotthem](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/paulvancotthem/32/66774_2.png) [@paulvancotthem](https://discuss.ai.google.dev/u/paulvancotthem)\
**Post date:** [November 23, 2025, 5:02pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/18 "2025-11-23T17:02:40Z")

</div>

Thanks for the tip; it gives me hope for a solution. Unfortunately, I’m very new to Firebase integration, so I don’t quite understand yet what you mean. Could you explain it in simple, beginner-friendly terms?

---

<div class="post-metadata">

**Author:** ![Jean-baptiste\_Durand](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/jean-baptiste_durand/32/73688_2.png) [@Jean-baptiste\_Durand](https://discuss.ai.google.dev/u/Jean-baptiste_Durand)\
**Post date:** [November 25, 2025, 8:47am UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/20 "2025-11-25T08:47:59Z")

</div>

I have the same issue. I tried all of possible solution mentioned in the ticket but always have the problem. Anyone can help ?

---

<div class="post-metadata">

**Author:** ![Chris13](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/chris13/32/72959_2.png) [@Chris13](https://discuss.ai.google.dev/u/Chris13)\
**Post date:** [November 25, 2025, 12:10pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/22 "2025-11-25T12:10:20Z")

</div>

Basically, it’s important to understand that Google AI Studio is just a preview and essentially only handles the front end. As soon as you want to do anything with authentication or verification, it won’t work with AI prompts out of the box.  
Furthermore, you don’t have direct access to important files within AI Studio, so I imagine it’s not possible to display such things in the web preview. Perhaps the AI ​​adjusts it from time to time so that it works for some, but perhaps it doesn’t always do that; in any case, it’s not designed for that at all, and it’s a gamble whether it works or not, simply because you don’t have direct access.

For those less familiar with this, it might be helpful to download the app within Google AI Studio and import it into Firebase Studio where you have access to all files and continue development there. The AI ​​in Firebase handles automatic integration about 70% of the time, but yes, it doesn’t always work perfectly. In those cases you need to define and configure it manually. However, there’s excellent documentation for this in Firebase.

> **[Firebase Authentication](https://firebase.google.com/docs/auth)**
>
> Firebase Authentication lets you add an end-to-end identity solution to your app for easy user authentication, sign-in, and onboarding in just a few lines of code.

> **[From vibe to reality: Integrating Firebase in Firebase Studio](https://firebase.blog/posts/2025/07/integrating-firebase-in-firebase-studio)**
>
> News, tutorials, and updates from the Firebase team.

---

<div class="post-metadata">

**Author:** ![paulvancotthem](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/paulvancotthem/32/66774_2.png) [@paulvancotthem](https://discuss.ai.google.dev/u/paulvancotthem)\
**Post date:** [November 25, 2025, 3:28pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/24 "2025-11-25T15:28:09Z")

</div>

Thanks, will try this.

Still, Google would have a lot to win by making Firebase integration in Google AI Studio easy and solid.

See my request: [Google AI Studio - Feature Request: Add Native "One-Click" Firebase/Firestore Provisioning](https://discuss.ai.google.dev/t/google-ai-studio-feature-request-add-native-one-click-firebase-firestore-provisioning/109641)

---

<div class="post-metadata">

**Author:** ![Chris13](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/chris13/32/72959_2.png) [@Chris13](https://discuss.ai.google.dev/u/Chris13)\
**Post date:** [November 25, 2025, 4:12pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/25 "2025-11-25T16:12:59Z")

</div>

I don’t think that will happen. AI Studio was and is only for playing around with AI for devs, not really for productive projects. But yes, I have used it also for productive projects, as I feel I can get usable one-shots for small things right away. Google has integrated it too well ;D

But if you really want to work with AI, and your own project is growing, I would recommend getting to other platforms like Firebase Studio as quickly as possible and getting used to them. AI Studio will probably always be a small testing ground that will gradually be reduced, and you have little safety there, as they can remove or add something at any time that could make your old apps unusable. Firebase Studio will be more stable for longer and uses an absolute standard in its core with VS Code which is then much easier for scaling, since you are then platform-independent.

---

<div class="post-metadata">

**Author:** ![paulvancotthem](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/paulvancotthem/32/66774_2.png) [@paulvancotthem](https://discuss.ai.google.dev/u/paulvancotthem)\
**Post date:** [November 25, 2025, 4:43pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/26 "2025-11-25T16:43:43Z")

</div>

Maybe so.

It depends on whether Google Marketing sees new incremental opportunities in reaching markets with “easy-to-use” coding tools like Google AI Studio, compared to more complex pro tools.

There’s a huge untapped market, IMHO, for in-house vibe coding at businesses of all sizes, often requiring multi-user features like saving individual preferences or data. Adding that to an affordable, low-effort, AI-assisted, coding tool could open the door for Google to reach this audience.

Even professional developers could benefit, especially for rapid prototyping.

Perhaps Firebase Studio is such a product. Google AI Studio surely is, or could be.

---

<div class="post-metadata">

**Author:** ![paulvancotthem](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/paulvancotthem/32/66774_2.png) [@paulvancotthem](https://discuss.ai.google.dev/u/paulvancotthem)\
**Post date:** [November 30, 2025, 8:10pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/28 "2025-11-30T20:10:41Z")

</div>

**UPDATE 2025-11-30** : I can now successfully add Firebase Authentication using the email/password sign-in method to any app I build in Google AI Studio. It’s not exactly rocket science, but it does involve several steps and required thoroughly studying the documentation. The apps are deployed using Google AI Studio’s built-in Cloud Run service, so there was no need to set up any backend, aside from Firebase, of course.

---

<div class="post-metadata">

**Author:** ![Jason\_Rich](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/jason_rich/32/32355_2.png) [@Jason\_Rich](https://discuss.ai.google.dev/u/Jason_Rich)\
**Post date:** [December 3, 2025, 3:29pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/30 "2025-12-03T15:29:46Z")

</div>

Can you point me to what documentation you worked through? Or even copy the steps you did to get past this? This is driving me crazy, i don’t get why this of all things, is the hardest part to accomplish!

---

<div class="post-metadata">

**Author:** ![AstroNight](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/astronight/32/111258_2.png) [@AstroNight](https://discuss.ai.google.dev/u/AstroNight)\
**Post date:** [April 5, 2026, 7:28am UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/32 "2026-04-05T07:28:08Z")

</div>

This is a bit funny now in retro spec… as FireBase Studio is up for sunset and they are migrating users to Ai Studio or AntiGravity. but yes, alway ensure you have manual backups via github/git and or manual zip backup for eternal safety and use in other Agentic system where needed or helpful.

> **[Firebase Studio sunset and project migration](https://firebase.google.com/docs/studio/migrating-project)**
>
> A guide to migrating your Firebase Studio projects to Google AI Studio or Google Antigravity.

---

<div class="post-metadata">

**Author:** ![system](https://d1dlmcr85iqnpo.cloudfront.net/user_avatar/discuss.ai.google.dev/system/32/1_2.png) [@system](https://discuss.ai.google.dev/u/system)\
**Post date:** [November 5, 2026, 6:37pm UTC](https://discuss.ai.google.dev/t/ai-studio-app-builder-with-firebase-authentication-authorized-domain-error/91517/33 "2026-11-05T18:37:44Z")

</div>

Closed on November 5, 2026, 6:37pm UTC

This thread was automatically closed 60 days after the last reply. If you are running into an issue, please create a new post.
