无法完成授权

时间:2017-11-20 15:02:45

标签: linkedin-api

我已经创建了LinkedIn API应用,我可以进入“允许”屏幕。重定向到我网站上的一个表单,该表单将提交给linkedin.com以完成授权。 而不是重定向到我的重定向网址,我收到一个错误说: “您必须通过身份验证才能访问此页面。”

下面是我提交的表单,除了我已经用fakes替换了表单字段值。 我确保在我的LinkedIn应用程序中验证了真正的重定向URL。 我做错了什么?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SoftLink Systems LinkedIn Auth Completion</title>
</head>
<body>
<form id="frmLNAuthComplete" action="https://www.linkedin.com" enctype="application/x-www-form-urlencoded" method="post" >
    <input type="hidden" name="grant_type" value="authorization_code" />
    <input type="hidden" name="code" value="FAKE_CODE_Gdy1R3cW2hFACX2dV39QwfofGVXg6v1nPH0O_Em4UnzEaR06ZXDGO57HU0DukpehS-EGu-AzF3L8SG8XfrB6oYRkpPtY3cLc" />
    <input type="hidden" name="redirect_uri" value="http://linkedin.fake-domain.com/index.php" />
    <input type="hidden" name="client_id" value="fake-id-k66l" />
    <input type="hidden" name="client_secret" value="fake-secret-rI2mxlqb" />
</form>
<script type="application/javascript">  
    var frm = document.querySelector("#frmLNAuthComplete"); 
    frm.submit();   
</script>
</body>
</html>

0 个答案:

没有答案