Пример #1
0
Файл: jwt.py Проект: whaker/zato
    def handle(self):
        token = JWTBackend(self.kvdb, self.odb, self.server.fs_server_config.misc.jwt_secret).authenticate(
            self.request.input.username, self.request.input.password)

        if token:
            self.response.payload = {'token': token}
            self.response.headers['Authorization'] = token

        else:
            raise Unauthorized(self.cid, 'Invalid username or password', 'jwt')
Пример #2
0
 def _raise_unauthorized(self):
     raise Unauthorized(self.cid,
                        'You are not authorized to access this resource',
                        'Zato pub/sub')
Пример #3
0
 def _raise_unathorized(self):
     raise Unauthorized(self.cid, 'Invalid credentials', 'jwt')