diff --git a/authentik/stages/authenticator_mobile/api/device.py b/authentik/stages/authenticator_mobile/api/device.py index c54d935d4..adc92487e 100644 --- a/authentik/stages/authenticator_mobile/api/device.py +++ b/authentik/stages/authenticator_mobile/api/device.py @@ -29,10 +29,14 @@ class MobileDeviceSerializer(ModelSerializer): class MobileDeviceEnrollmentSerializer(PassiveSerializer): + """Enrollment request, send the device's unique identifier""" + device_uid = CharField(required=True) class MobileDeviceSetPushKeySerializer(PassiveSerializer): + """Set notification key""" + firebase_key = CharField(required=True) diff --git a/authentik/stages/authenticator_mobile/stage.py b/authentik/stages/authenticator_mobile/stage.py index 3e9da05db..e85cd0c9c 100644 --- a/authentik/stages/authenticator_mobile/stage.py +++ b/authentik/stages/authenticator_mobile/stage.py @@ -62,7 +62,7 @@ class AuthenticatorMobileStageView(ChallengeStageView): data={ # TODO: use cloud gateway? "u": self.request.build_absolute_uri("/"), - "s": self.executor.plan.context[FLOW_PLAN_MOBILE_ENROLL].device.pk, + "s": str(self.executor.plan.context[FLOW_PLAN_MOBILE_ENROLL].device.pk), "t": self.executor.plan.context[FLOW_PLAN_MOBILE_ENROLL].token, } ) diff --git a/schema.yml b/schema.yml index 4e576240a..79b072cad 100644 --- a/schema.yml +++ b/schema.yml @@ -2272,7 +2272,11 @@ paths: - mobile_device_token: [] responses: '204': - description: No response body + content: + application/json: + schema: + type: string + description: '' '400': content: application/json: @@ -35224,6 +35228,7 @@ components: - token MobileDeviceEnrollmentRequest: type: object + description: Enrollment request, send the device's unique identifier properties: device_uid: type: string @@ -35247,6 +35252,7 @@ components: - name MobileDeviceSetPushKeyRequest: type: object + description: Set notification key properties: firebase_key: type: string