Skip to content

Error 403 - unauthorized to use Firebase Auth #3053

@LucaDaniele99

Description

@LucaDaniele99
  • Operating System version: Ubuntu Server 24.04
  • Firebase SDK version: 13.6.0
  • Firebase Product: auth (auth, database, storage, etc)
  • Node.js version: 22.13
  • NPM version: 10.9.2

Describe the problem

Steps to reproduce:

On NodeJS server, when trying to create/delete an user on Firebase Auth I get the following error:

 errorInfo: {
    code: 'app/unable-to-parse-response',
    message: `Error while parsing response data: "SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON". Raw server response: "<!DOCTYPE html>\n` +

....................
....................

'  <p>Your client does not have permission to get URL <code>/v1/projects/skicoach-ld/accounts</code> from this server.  <ins>That’s all we know.</ins>\n' +
      '". Status code: "403". Outgoing request: "POST https://identitytoolkit.googleapis.com/v1/projects/skicoach-ld/accounts."'
  },
  codePrefix: 'app'
}

Firebase is initialized in this way:

const firebase = require('firebase-admin');
firebase.initializeApp({
	credential: firebase.credential.cert(require('./firebase_adminsdk.json'))
});
const auth = firebase.auth();

and code to create the user is:

auth.createUser({
	email: req.body.email,
	emailVerified: true,
	password: req.body.password,
	displayName: req.body.name+" "+req.body.surname,
	disabled: false
})

it always worked so I don't understand where's the issue now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions