Custom auth get 400 error with CONFIGURATION_NOT_FOUND
Follow the document to run custom auth code, but get the errors as below, did I miss something to config?
{
"code":"auth/internal-error",
"message":{
"error":{
"code":400,
"message":"CONFIGURATION_NOT_FOUND",
"domain":"global",
"reason":"invalid"
}
}
}
Can you explain the steps you took to get to this error more exactly? "Follow the document to run custom auth code" is not enough information for me to try and reproduce or debug this issue.
I'm having this issue too...
I hope the original poster doesn't mind my answering his question. If our cases are different, I'll be sure to create a new ticket so that I don't hijack this one.
I'm using custom authentication, i.e. generating a token within my server/Node.js app running the Admin SDK:
const token = await firebaseAdmin.auth().createCustomToken(req.currentUser.uuid);
this code returns a token to my client application. The req.currentUser.uuid is a UUID belonging to that user. Client side I'm doing this:
return firebase.auth().signInWithCustomToken(data.firebaseToken);
data.firebaseToken is the token provided from the above step. The response:
code: "auth/internal-error"
message: "{"error":{"code":400,"message":"CONFIGURATION_NOT_FOUND","errors":[{"message":"CONFIGURATION_NOT_FOUND","domain":"global","reason":"invalid"}]}}"
My client application is registered and working fine without authentication, so the Firebase config file should be correct (it is unchanged from what is provided in the console). Here is the client side init:
import firebase from "firebase/app";
import "firebase/auth";
import { firebaseConfig } from "../firebaseConfig";
firebase.initializeApp(firebaseConfig);
Thanks in advance for helping us out!
Came across a fix for this... Simply visit the "Authentication" section of the Firebase console and click "enable". You don't have to configure any identity providers, but this error means that an identity provider was not found, perhaps because this API was simply not enabled.
Maybe the firebase console UI has changed since the last reply, but I went to the firebase console -> authentication, then clicked "Get Started". And that's all.
Thanks, seems this error is due to authentication is not enabled, thanks all for help!
Is there a way to automate the enabling Email/Password Authentication from Firebase ? Need to do this in multiple project and any automation around would be helpful. Tried looking for Firebase API for the same. No luck so far.
Please help if anyone found solution to make it fully automated.
@Jenishk56 , Go to Authentication -> Sign-in method. Then enable the Email/Password Provider
Thanks @joeauty! That fixed the issue for me