manager.py 文件源码

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

项目:flask-kerberos-login 作者: ContinuumIO 项目源码 文件源码
def extract_token(self):
        '''
        Extracts a token from the current HTTP request if it is available.

        Invokes the `save_user` callback if authentication is successful.
        '''
        header = request.headers.get(b'authorization')
        if header and header.startswith(b'Negotiate '):
            token = header[10:]
            user, token = _gssapi_authenticate(token, self._service_name)
            if token is not None:
                stack.top.kerberos_token = token

            if user is not None:
                self._save_user(user)
            else:
                # Invalid Kerberos ticket, we could not complete authentication
                abort(403)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号