-1
我正在尝试构建一个可以从用户的Google日历中获取事件的应用程序。一旦我得到用户授权并要求在另一页面输入的授权码,我尝试将其交换为access_token。但是我发送的发送请求中的错误是为了检索令牌。使用Google的oauth使用授权码获取访问令牌的错误
client_id=encodeURIComponent("id.apps.googleusercontent.com");
client_secret=encodeURIComponent("secret.apps.googleusercontent.com");
$.post("http://accounts.google.com/o/oauth2/token/code="+auth_code
+"&client_id="+client_id+"&client_secret="+client_secret
+"&redirect_uri=urn:ietf:wg:oauth:2.0:oob&grant_type=authorization_code",
function(response){
console.log('Response = '+ response);
}
);
有人能告诉我发布的请求中的错误吗?
我实际上是在使用错误的流程。谢谢@ryan boyd。 – Elly
我的应用程序应该在智能电视中工作。我想从Google日历中提取用户的事件并为它们创建警报。 – Elly