简体   繁体   中英

Firebase reset password link not working

I am using firebase to authenticate users in my android app. I provide user an option to reset password in login window. When user click on button, it sends email successfully. However when user clicks on link, it always showing

" Try resetting your password again . Your request to reset your password has expired or the link has already been used"

在此处输入图像描述

Anyone knows where I'm Wrong? I tried login with different email IDs from different devices. Still not working. I am using ' com.google.firebase:firebase-auth:9.2.0 '.

UPDATE on 31 August 2016

I got in touch with firebase support and it looks like there was some bug with API key. If you change your browser API key, it was not getting updated. Now this bug is fixed and reset password function is working properly.

If you've listed any HTTP referrers for your app's API key in the Google API console , you need to include the app itself which is where the emails originate: <app-name>.firebaseapp.com . Otherwise this domain is not valid for your app's key.

I had the same issue and solve it. But the protocol should be https .

And in the end of URL I have to add the /* as there will be token, api_key and other parameters added by firebase here.

https://Project ID.firebaseapp.com/* (I get my Project ID from the firebase console)

I discovered what the issue was in my case...

For me, it had nothing to do with the credentials settings. It was simply that under Authentication/Sign-in method in the Console, I had Email/Password provider disabled. Once I turned that on, reset email links began working properly again.

Temporarily I've solved the issue by leaving only one unrestricted API key at Google API Console

在此处输入图片说明

This is how I solved, a slightly different approach from the top answer : First indeed check which API KEY is being used in the email link, in my case was the PROD one even if I was starting the project with the DEV(unrestricted) one.

The most important thing: it's not enough to add <app-name>.firebaseapp.com. in the Website restrictions section of your API KEY : you need to add the fully qualified domain including https: https://<app-name>.firebaseapp.com. This solved the issue for me.

I also experienced the same issue, and for me, the cause was sending multiple password reset emails, and I got only the first one.

Make sure you send the reset password email just once or if you did it multiple times, wait for the multiple emails to arrive and use the latest email .

我能够通过从电子邮件中删除链接选项来修复它(无需密码访问)在此处输入图像描述

I was able to fix it just by removing my current firebase app and creating a new one. 在此处输入图像描述 在此处输入图像描述

For users using API restrictions for their keys

The most upvoted answers didn't help me because I already used API restrictions for my key for security reasons. This means I cannot have HTTP referrers and API restrictions at the same time. At least it didn't work for me. After checking my API usage dashboard I realized that the API that's being used for signing up is called Identity Toolkit . I added it to the restricted APIs and it worked!

在此处输入图像描述

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM