Home
Sign Up
Sign In
›
Django Project
›
Django REST Framework
V2EX
›
Django
求django 编写授权服务思路
337240552
·
Jan 18, 2013
· 4561 views
This topic created in 4909 days ago, the information mentioned may be changed or developed.
我想写个app,服务器端搞成api的形式,但是怎么对api进行授权访问呢?比如说登录后才能对某些api请求,我现有的思路是客户端请求时带着session id,到服务器短查 session有没有效,有效则允许。但感觉麻烦了些,是否有更好的思路呢,大牛们点评下。
API
Session
思路
8 replies
•
1970-01-01 08:00:00 +08:00
1
iiduce
Jan 18, 2013
http://django-rest-framework.org/
2
swulling
Jan 18, 2013
1
你这种需求Cookie就好了。。
3
337240552
OP
Jan 18, 2013
@
iiduce
谢谢,我这看看
4
337240552
OP
Jan 18, 2013
@
swulling
mobile之类的app木有cookie哦
5
swulling
Jan 18, 2013
@
337240552
怎么会没有,退一万步讲,不过就是个http header么
6
337240552
OP
Jan 18, 2013
@
swulling
恩,你的意思就是客户端存一个标识,然后没次请求都带上,到服务器端对比,是这样吗
7
swulling
Jan 18, 2013
@
337240552
cookie本来就是干这个的,不过不用重复做轮子了,直接用就好了。
java objc python ,只要是能说上名字的http lib,均可以非常有效的处理cookie。。
8
notedit
Jan 18, 2013
1
http://www.thebuzzmedia.com/designing-a-secure-rest-api-without-oauth-authentication/
About
·
Help
·
Advertise
·
Blog
·
API
·
FAQ
·
Solana
·
3194 Online
Highest 6679
·
Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 52ms ·
UTC 12:22
·
PVG 20:22
·
LAX 05:22
·
JFK 08:22
♥ Do have faith in what you're doing.
❯