我在Hellosign注册了一个应用程序,并在本地使用django项目。
在重新绑定应用程序时,它需要OAuth
回调的域网址,因为我使用的是localhost,我已经给出了https://ngrok.com/生成的回调网址。
喜欢:https://1a2df3ef.ngrok.com/test/oauth
Django oauth url mapping就像
url(r'^hellosign/oauth', 'hellosignup_oauth'),
视图
def hellosignup_oauth(request):
code = request.GET.get('code')
return render(request, 'hello.html', {'code': code})
授权时,请求类似
https://1a2df3ef.ngrok.com/test/oauth?&code=17c2264f2a24741c&state=900e06e2
并且ngrok会像
一样收到请求 hellosign/oauth
似乎有两个问题:
1)ngrok应该收到请求hellosign/oauth?&code=17c2264f2a24741c&state=900e06e2
而不是hellosign/oauth
。
2)hellosign/oauth
视图未在请求hellosign/oauth
有什么见解?
答案 0 :(得分:0)
这不应该是一个问题,但看起来你有一个空的URL参数(即"?&")。可能是Django看到空的第一个参数并放弃第二个参数吗?