前景提要
HDC调试需求开发(15万预算),能者速来!>>>
创建了新浪微博的站内应用,使用python sdk,参照Oauth2.0的例子,写了下面代码: CONSUMER_KEY = '**************' CONSUMER_SECRET = '*************' auth = APIClient(app_key=CONSUMER_KEY,app_secret=CONSUMER_SECRET,redirect_uri='http://apps.weibo.com/ddmkchan/') def oauth(request): auth_url = auth.get_authorize_url() return HttpResponseRedirect(auth_url) def index(request): code = request.GET.get('code') request.session['code'] = code if not code: return HttpResponseRedirect('http://ddmkchan.sinaapp.com/sinaweibo/oauth') else: r = auth.request_access_token(code) access_token = r.access_token expires_in = r.expires_in auth.set_access_token(access_token,expires_in) request.session['access_token'] = access_token request.session['expires_in'] = expires_in .....
现在的情况是:
我在自己电脑上能顺利访问应用,顺利调用新浪微博API,但是在其他机器上,使用其他微博帐号,授权并访问应用就出现access_token的问题。
access_token保存在session中。
菜鸟求指导!