React + Firebase API issue

I am encountering a 403 Forbidden error when trying to access the Google Sign-In page using my Project IDX setup. The error occurs at https://accounts.google.com/v3/signin/identifier. How can I resolve this issue and ensure proper OAuth 2.0 integration and access permissions for my Google Cloud project?

before that I got cors issue but I used cors unblock and it went away

My project is React vite with firebase, I have a server directory, I want to get back the users from the firebase database but at the fetch I get this error

here’s my app.js:


import express from 'express';
import admin from 'firebase-admin';
import cors from 'cors';

const app = express();
const port = 3001;

import serviceAccount from './pharmax-uniq-firebase-adminsdk-ai396-a89298cc66.json' assert { type: 'json' };


app.use(cors());


admin.initializeApp({
    credential: admin.credential.cert(serviceAccount)
});

app.get('/', (req, res) => {
    res.send('Server is running!');
});

app.get('/users', async (req, res) => {
    try {
        const listUsersResult = await admin.auth().listUsers();
        const users = listUsersResult.users.map(user => ({
            uid: user.uid,
            email: user.email,
            displayName: user.displayName
        }));
        res.json(users);
    } catch (error) {
        console.error('Error listing users:', error);
        res.status(500).send('Error listing users');

    }
});

app.delete('/users/:uid', async (req, res) => {
    const uid = req.params.uid;
    try {
        await admin.auth().deleteUser(uid);
        res.send('User deleted successfully');
    } catch (error) {
        console.error('Error deleting user:', error);
        res.status(500).send('Error deleting user');
    }
});

app.listen(port, () => {
    console.log(`Server listening at http://localhost:${port}`);
});



any help will be appreciated, thanks.

You’ll need to add the subdomain that IDX hosts your app as an authorized domain in the Firebase Console.

https://firebase.google.com/project/ YOUR-PROJECT-ID /authentication/settings

1 Like

Thanks man, It worked!

1 Like