【问题标题】:why am I getting an "invalid_request"?为什么我收到“invalid_request”?
【发布时间】:2020-11-24 03:28:32
【问题描述】:

我正在尝试使用 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://本地主机:9011 /的oauth2 /无口令/ 5NHh37raOrUpSO4TlJcL-pY39i1TdasNd9vTTqqaiLk tenantId = 34303566-6466-3234-6565-656233663263&CLIENT_ID = 32688330-1630-4e0d-a4de-8ae45c3ca527&REDIRECT_URI = HTTP%3A%2F%2FXX15582f3e2c.ngrok.io% 2Findex.php%2FConfigure%2FMyFormEmployees&response_type=code&scope=openid&state=CSRF123

这会导致无效的 URI 错误。我怎样才能让这个链接起作用?

【问题讨论】:

    标签: fusionauth


    【解决方案1】:

    您需要将 http://XX15582f3e2c.ngrok.io/index.php/Configure/MyFormEmployees 添加到授权重定向 URI 列表中。在 FusionAuth 控制台中,查看Applications > Edit > OAuth > Authorized redirect URLs

    【讨论】:

    • 谢谢丹。我其实已经有了。当我从电子邮件链接中提取重定向 uri 并将其粘贴到我的浏览器中时,似乎发现页面很好。我看到你对其他人的评论,他们需要在服务器中将“在重定向中使用精确的 uri”设置为 false。你指的是哪个服务器?我的阿帕奇? php.ini 中的某个地方?还有其他想法吗?
    猜你喜欢
    • 2020-08-23
    • 2017-08-17
    • 2020-09-18
    • 2012-05-27
    • 2020-03-09
    • 2020-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多