我不断从 Windows Live 收到此错误
为输入参数“redirect_uri”提供的值无效。预期值为“https://login.live.com/oauth20_desktop.srf”或与重定向匹配的 URL
为什么我一直收到这个错误。我在 Windows Live 开发者应用程序中设置了域
在我的 <head> 元素中
<script src="//js.live.net/v5.0/wl.js"></script>
在我的 <body> 元素下方
WL.init({
client_id: '{S_AL_WL_CLIENT_ID}', //{S_AL_WL_CLIENT_ID} = phpbb template variable for client_id
redirect_uri: '{AL_BOARD_URL}', //{AL_BOARD_URL} = phpbb template variable for the urlencoded domain name
response_type: 'token',
scope: ["wl.signin", "wl.basic", "wl.birthday", "wl.emails", "wl.work_profile", "wl.postal_addresses"]
});
登录按钮是
<div id="login">
<a href="#"><img src="images/windows_live_connect.png" alt="Windows Live" /></a>
</div>
听者
jQuery('#login a').click(function(e)
{
e.preventDefault();
WL.login({
scope: ["wl.signin", "wl.basic", "wl.birthday", "wl.emails", "wl.work_profile", "wl.postal_addresses"]
}).then(function (response)
{
//do something with stuff here. You know brainy type ajaxy stuff to auth a user
},
function (responseFailed)
{
console.log("Error signing in: " + responseFailed.error_description);
});
});