我在 Hellosign 注册了一个应用程序,并在本地用于 django 项目。
OAuth
由于我使用的是本地主机,因此在重新绑定应用程序时它需要域 url 进行回调,我给出了一个由https://ngrok.com/生成的回调 url 。
喜欢:https://1a2df3ef.ngrok.com/test/oauth
Django oauth url映射就像
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
有什么见解吗?