diff --git a/authentik/stages/authenticator_mobile/api/device.py b/authentik/stages/authenticator_mobile/api/device.py index 84aa71e88..c773c22fa 100644 --- a/authentik/stages/authenticator_mobile/api/device.py +++ b/authentik/stages/authenticator_mobile/api/device.py @@ -44,6 +44,7 @@ class MobileDeviceInfoSerializer(PassiveSerializer): ) os_version = CharField() model = CharField() + hostname = CharField() app_version = CharField() @@ -120,6 +121,7 @@ class MobileDeviceViewSet( device: MobileDevice = self.get_object() data = MobileDeviceEnrollmentSerializer(data=request.data) data.is_valid(raise_exception=True) + device.name = data.validated_data["info"].validated_data["hostname"] device.confirmed = True device.device_id = data.validated_data["device_uid"] device.save() diff --git a/schema.yml b/schema.yml index 5559f9e59..70276b80f 100644 --- a/schema.yml +++ b/schema.yml @@ -35307,11 +35307,15 @@ components: model: type: string minLength: 1 + hostname: + type: string + minLength: 1 app_version: type: string minLength: 1 required: - app_version + - hostname - model - os_version - platform