I am trying to authenticate using signIn()
method and exact replica of example code from ESP32 Client library (the new version)
WiFi
and also I can
successfully CREATE
new account from the ESP32 board.Firebase authentication
signup with email/pass
is enabled.In my serial monitor I can read that the error code is 400
this:
Code that I am using:
Serial.printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION);
/* Assign the api key (required) */
fb_config.api_key = API_KEY;
/* Assign the user sign in credentials */
fb_auth.user.email = email_name.c_str();
fb_auth.user.password = email_name.c_str();
/* Assign the RTDB URL */
fb_config.database_url = DATABASE_URL;
Firebase.reconnectWiFi(true);
fb_do.setResponseSize(4096);
/* Assign the callback function for the long running token generation task */
fb_config.token_status_callback = tokenStatusCallback; //see addons/TokenHelper.h
/** Assign the maximum retry of token generation */
fb_config.max_token_generation_retry = 5;
/* Initialize the library with the Firebase authen and config */
Firebase.begin(&fb_config, &fb_auth);
if(Firebase.authenticated()){
Serial.println("I am authenticated");
} else {
Serial.println("Well I AM NOT???");
}
Screenshot from my Firebase authentication that my ESP32 was created and also logged in today:
I know my Firebase initialization was successful because I can read and write read data into the Realtime database:
I am using PlatformIO
and this is my config file:
[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
monitor_speed = 115200
build_flags = -D PIO_FRAMEWORK_ARDUINO_MMU_CACHE16_IRAM48_SECHEAP_SHARED
lib_deps =
mobizt/Firebase Arduino Client Library for ESP8266 and ESP32@^2.5.4
bblanchon/ArduinoJson@^6.18.5
Firebase.authenticated()
method too early, and the Firebase did not
have time to authenticate.loop()
it works.GitHub discussion where we find the solution.