diff --git a/authentik/stages/password/stage.py b/authentik/stages/password/stage.py index fddde51b6..ddcfe84dc 100644 --- a/authentik/stages/password/stage.py +++ b/authentik/stages/password/stage.py @@ -69,7 +69,7 @@ class PasswordChallenge(WithUserInfoChallenge): class PasswordChallengeResponse(ChallengeResponse): """Password challenge response""" - password = CharField() + password = CharField(trim_whitespace=False) component = CharField(default="ak-stage-password") diff --git a/authentik/stages/prompt/models.py b/authentik/stages/prompt/models.py index 60bde42c6..d5ca18bff 100644 --- a/authentik/stages/prompt/models.py +++ b/authentik/stages/prompt/models.py @@ -85,7 +85,8 @@ class Prompt(SerializerModel): kwargs = { "required": self.required, } - + if self.type == FieldTypes.TEXT: + kwargs["trim_whitespace"] = False if self.type == FieldTypes.TEXT_READ_ONLY: field_class = ReadOnlyField if self.type == FieldTypes.EMAIL: