問題描述
如何使用身份驗證 API 觸發密碼重置流程、python 或 curl (How to use the authentication API to trigger password reset flow, python or curl)
我正在嘗試通過身份驗證 api 使用 auth0 觸發密碼重置流程。
我不斷收到此錯誤:{"error":"email or username are required."}
按照此處的說明進行操作:https://auth0.com/docs/connections/database/password‑change#using‑the‑authentication‑api
我正在嘗試從 jupyter筆記本電腦或我 Mac 上的終端。我需要對儀表板中的 Allowed web origins 設置做些什麼嗎?
python 請求如下所示:
import requests
payload = "{\"client_id\": \"<MYCLIENTID>\",\"email\": \"<EMAIL>\",\"connection\": \"Username‑Password‑Authentication\"}"
headers = { 'content‑type': "application/json" }
url = "https://<MYDOMAIN>/dbconnections/change_password"
print(requests.post(url, payload).text)
curl 請求如下所示:
參考解法
方法 1:
The connection is disabled
errors usually indicate that the connection you are trying to use (Username‑Password‑Authentication
), is not enabled on the given Application/Client.
To enable the connection for this Application, go to Applications, select your Application and click on the Connections tab. Here you will see the list of all connections. Make sure the Database connection you are trying to use is enabled. It is advised to have only one enabled Database connection per Client/Application.
(by Ludo、Shayan Memari)