fusionauth - 为什么我收到“invalid_request”?
问题描述
我正在尝试使用 FusionAuth 的无密码登录功能。当我尝试单击收到的电子邮件中的链接时,我收到一个错误“无效的重定向 uri”。我正在使用 php 客户端。
$request = array();
$request["applicationId"] = $_SESSION['applicationID'];
$request["loginId"] = $email;
$target="http://8615582f3e2c.ngrok.io/index.php/Configure/MyFormEmployees";
$request["state"]["redirect_uri"] = $target;
$request["state"]["client_id"]=$_SESSION['applicationID'];
$request["state"]["response_type"]= "code";
$request["state"]["scope"]= "openid";
$request["state"]["state"]= "CSRF123";
$requestJ = json_encode($request); //convert the array into json
$result = $_SESSION['client']->startPasswordlesslogin($requestJ);
这就是我在电子邮件中作为链接收到的内容:http://localhost:9011/oauth2/passwordless/5NHh37raOrUpSO4TlJcL-pY39i1TdasNd9vTTqqaiLk?tenantId=34303566-6466-3234-6565-656233663263&client_id=326488330-de-d-a4-a4- 8ae45c3ca527&redirect_uri=http%3A%2F%2FXX15582f3e2c.ngrok.io%2Findex.php%2FConfigure%2FMyFormEmployees&response_type=code&scope=openid&state=CSRF123
这会导致无效的 URI 错误。我怎样才能让这个链接工作?
解决方案
您需要添加http://XX15582f3e2c.ngrok.io/index.php/Configure/MyFormEmployees
到授权重定向 URI 列表。在 FusionAuth 控制台中,请参阅Applications > Edit > OAuth > Authorized redirect URLs
.
推荐阅读
- java - Android ListView 项目太大不知道为什么
- c++ - 强制 CMake 重建预编译的头文件
- java - 运行 docker 容器“NoClassDefFoundError”时出错
- google-data-studio - 在 Google Data Studio 中可视化仪表板时动态创建/访问图表
- error-handling - 为什么会出现错误提示“尝试使用 'Position' 索引 nil”?
- python - 尝试使用 Python 解析 XLS (XML) 文件
- r - R 中每行的前 3 个值
- ios - 为什么 == 和 === 相等性似乎对 UIView 类起作用?
- curl - Synology NAS 上的 RCurl 找不到 curl-config
- python-3.x - Python 3 不支持 MySQL-python