auth.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:nanosphere 作者: walkr 项目源码 文件源码
def decode_jwt(token, options=None):
    """ Authenticate via JSON Web Token

    Options: `secret`, `algorithms` """

    options = options or {}
    secret = options.get('secret', CONF and CONF.secret)
    algorithms = options.get('algorithms', CONF and CONF.algorithms)

    try:
        data = jwt.decode(token, secret, algorithms)
    except jwt.DecodeError:
        raise Exception('Cannot decode token')
    else:
        logging.debug('* Decoded data = {}'.format(data))
        return data
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号