【发布时间】:2018-12-31 12:39:20
【问题描述】:
我正在尝试创建一个网页,以实现 Autodesk 的 Forge 教程中描述的“Get a 3-Legged Token with Authorization Code Grant”过程的第 1 步。但是当我运行它时,我得到一个错误:错误:400 - 无效的redirect_uri
这是我的代码:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Get_a_3-Legged_Token_with_Authorization_Code_Grant.php</title>
</head>
<body>
<?php
// Derivedfrom API tutorial here:
// https://developer.autodesk.com/en/docs/oauth/v2/tutorials/get-3-legged-token/
$client_id = "HAqDtKO7VbuRgH0nL0MFJ0B02ElBEK3l";
$forge_Callback_URL_w_query_string = "http%3A%2F%2prod.sonautics.com/send_scan.php%3Fcmd%3Drefresh";
$forge_Your_WebSite_URL = "httpp%3A%2F%2prod.sonautics.com";
echo '<a href="https://developer.api.autodesk.com/authentication/v1/authorize?response_type=code'
. '&client_id=' . $client_id
. '&redirect_uri=' . forge_Callback_URL_w_query_string
. '&scope=data:read">Click here to grant access to your data!</a>'; ?>
</body>
</html>
我收到一个页面,上面写着:
哎呀
错误:400 - 无效的 redirect_uri
我们在应用程序配置方面遇到问题。
连接应用程序
请稍后再试。
我上面的代码很简单:你能帮我找出错误的来源并告诉我如何解决吗?
【问题讨论】:
-
我看到你的例子是使用
httpp而不是http,也许这也受到了影响。