def denied_response(self, req):
        if not hasattr(req, 'credentials_valid'):
            req.credentials_valid = None
        if req.remote_user or req.credentials_valid:
            return HTTPForbidden(request=req)
        else:
            return HTTPUnauthorized(request=req)
Returns a standard WSGI response callable with the status of 403 or 401
dataset/ETHPy150Open openstack/swauth/swauth/middleware.py/Swauth.denied_response