As part of a security certificate I need to provide a list of devices and their specifications that are connecting to a website.
To acheive this the current implementation uses uap-csharp in the global.asax which there are multiple stackoverflow question/answers around. Using the useragent I'm able to retrieve the make, OS and all the essential information I need execept for the exact model of a device (specific to mobile devices)
I've currently failed the certificate but can retest shortly if I can retreive the correct information but after hours of looking it doesn't seem possible to retreive the "exact" device model e.g. "Iphone 11 Pro" - I've looked at using fingerprinting with javascript but this appears to return roughly the same information from fingerprintjs as it would from the useragent.
Does anyone know of a way to capture the exact device model?
It's not possible, at least not reliably, through a web browser.
The
User-Agent
request header can be manipulated or spoofed, and even if it's not fake then it can be incomplete, incorrect, or unclear. In general it should be considered unreliable, and there is no alternative or better solution.Only a program that runs directly on the hardware can achieve this, and even then it may not always be possible to reach the level of detail or accuracy that you might desire.