diff --git a/flask_simpleldap/__init__.py b/flask_simpleldap/__init__.py index 612a223..ba5afd9 100644 --- a/flask_simpleldap/__init__.py +++ b/flask_simpleldap/__init__.py @@ -431,7 +431,7 @@ def basic_auth_required(self, func): def make_auth_required_response(): response = make_response("Unauthorized", 401) - response.www_authenticate.set_basic(current_app.config["LDAP_REALM_NAME"]) + response.headers['WWW-Authenticate'] = f'Basic realm="{current_app.config["LDAP_REALM_NAME"]}"' return response @wraps(func)