在基于令牌的身份验证中获取用户对象

时间:2016-05-23 07:49:16

标签: python oauth flask stormpath

我试图找出基于令牌的身份验证。特别是在stormpath。

1. client sign up
2. client logs in, get back a token. 
3. puts the token in the header of the following requests
4. server validates the token using stormpath api, and allows the user to enter the route.

这种基于令牌的会话基于令人困惑。

在基于会话的情况下,我会做http://flask-stormpath.readthedocs.io/en/latest/product.html#access-user-data

from flask.ext.stormpath import login_required, user

@app.route('/email')
@login_required
def name():
    return user.email

如何在基于令牌的每个路径中无缝访问用户对象?

0 个答案:

没有答案
相关问题