我一直在与MapMyFitness API
. 我让它工作并且授权运行顺利。在过去的两个月里,我的代码或他们的 API 似乎发生了一些变化。
在请求期间,我拨打了以下电话:
header("Location: http://api.mapmyfitness.com/3.1/oauth/authorize?oauth_token=123456789&oauth_callback=mysite.com/authorize.php);
它正确地将我发送到 MapMyFitness 站点以授予访问权限。我输入有效的用户名和密码,然后它会将我重定向到:
http://api.mapmyfitness.com/3.1/oauth/mysite.com/authorize.php?oauth_token=123456789
当然,网站和令牌是为这个例子组成的。如果我删除第一部分并留下实际的回调,mysite.com/authorize.php?oauth_token=123456789
它会正确运行。
看来 MapMyFitness 没有正确处理我的callback
并添加它的oauth url
.
如果我添加http://
到回调中,我会收到错误:
Unknown request token ""Array ( [oauth_token] =>
f36a684c04ef71d0a129dd59f5bbc1ed0514b4598 [oauth_callback] => SITE [PHPSESSID] =>
p284bpatpiuu78t0105qal4ql4 [fbsr_44829295357] => om1lyMi6U5iIyXqI3nfoWSBW5IoNV8skkJ-
fvW5qec8.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImNvZGUiOiJBUUFkSExOMkc0eWEtZk1NOF91WGtaNDhKMWN
DSmFQVnZEVm95RjZEdXRsNDVuYVRIUHNRdGxMRVhIQW9QSnJrNnhqWlZreTN6NzZCV1RTQWNaTXVTdl9HWEFNMDJkQ3p
1OE80dkhYT3lhUmdHVWl3bmdqcFF4SXYwQl9PUURNRlJzaG5wMDh2bjQ5UUI2S191ZHR5dXB5Z1dwbFNRdndqYTBiQ0h
IVExWN0ZialM5cnpjRGtnS0tVN2xyRVFXMVM2RTNkTzRQZHM1TnJjX0RrLVp3alEyRS0iLCJpc3N1ZWRfYXQiOjEzNjM
4ODQ3NTgsInVzZXJfaWQiOiIxMjcxODUyNTg0In0 [__utma] =>
252565653.331108727.1353966538.1363678118.1363880367.12 [__utmc] => 252565653 [__utmv] =>
252565653.|1=sex=M=1^2=age_group=35to44=1^3=membership=free=1^4=logged_in=is_logged_in=1
[__utmz] => 252565653.1363678118.11.4.utmcsr=mapmyrun.com|utmccn=
(referral)|utmcmd=referral|utmcct=/api/3.1/oauth/authorize
[mp_d4aec1d8aa5a6d2aebd49ec451910dea_mixpanel] => {"distinct_id": "13d37eedea042c-0033ca7c4-
376f6050-1aeaa0-13d37eedea1e62","$initial_referrer": "$direct","$initial_referring_domain":
"$direct","$search_engine": "google"} [optimizelyBuckets] => {} [optimizelySegments] =>
{"173102711":"safari","173022868":"false","172178767":"referral"} [__gads] =>
ID=2f74fc63a6725ad5:T=1362443034:S=ALNI_MblJOxnkm6q4rFDE8wihC_cUXHETQ [mmfsessid] =>
5a0f4259-05ae-4fe9-a45e-aa9f90afdfba [fbm_44829295357] => base_domain=.mapmyfitness.com
[optimizelyEndUserId] => oeu1353966536109r0.12621341994963586 )