Can't import user account with CLI Firebase auth:import command

后端 未结 2 2065
抹茶落季
抹茶落季 2021-01-05 22:46

I need to import a list of users, with email and password, in Firebase.

I\'m trying to import users in Firebase using the CLI auth:import command. (https://firebase

2条回答
  •  独厮守ぢ
    2021-01-05 23:04

    Thank you @wyhao31

    I use PHP to get user, data and password I need to import in Firebase.

    I used the hash_hmac() PHP function in a wrong way:

    $secret = "helpmeplease";  
    $password = "mypass";  
    $hmac_md5 = hash_hmac('md5', $password, $secret);  //3a52377f6635d298436013953a1ce4dd
    $base64 = base64_encode($hmac_md5); //M2E1MjM3N2Y2NjM1ZDI5ODQzNjAxMzk1M2ExY2U0ZGQ=
    

    To fix the problem I need to force the hmac_md5 output raw binary data:

    $secret = "helpmeplease";  
    $password = "mypass";  
    $base64 = base64_encode(hash_hmac('md5', $password, $secret, TRUE));  //OlI3f2Y10phDYBOVOhzk3Q==
    

    So I get your result, that works correctly!

    Thank you!

提交回复
热议问题