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')
def _raise_unauthorized(self): raise Unauthorized(self.cid, 'You are not authorized to access this resource', 'Zato pub/sub')
def _raise_unathorized(self): raise Unauthorized(self.cid, 'Invalid credentials', 'jwt')