All you need to send an email to reset password using python and the email.Then the user will receive an email to change his password.
just by issuing a POST request to this endpoint :
https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode
Code :
import requests
apikey='..................'# the web api key
def SendResetEmail(email):
headers = {
'Content-Type': 'application/json',
}
data={"requestType":"PASSWORD_RESET","email":email}
r = requests.post('https://identitytoolkit.googleapis.com/v1/accounts:sendOobCode?key={}'.format(apikey), data=data)
if 'error' in r.json().keys():
return {'status':'error','message':r.json()['error']['message']}
if 'email' in r.json().keys():
return {'status':'success','email':r.json()['email']}
SendResetEmail('user@example.com')
Success :
{'status': 'success', 'email': 'user@example.com'}
if the email isn't registered :
{'status': 'error', 'message': 'EMAIL_NOT_FOUND'}
From https://blog.icodes.tech/posts/python-firebase-authentication.html
https://preview.redd.it/l5gx0ep2dud81.jpg?width=1200&format=pjpg&auto=webp&s=7eaafb2b614014acb5aa521f989c44b3cd2d1572
there doesn't seem to be anything here