microsoftgraph / powershell-intune-samples

This repository of PowerShell sample scripts show how to access Intune service resources. They demonstrate this by making HTTPS RESTful API requests to the Microsoft Graph API from PowerShell.
MIT License
1.33k stars 653 forks source link

How to authenticate DEVICE using "Microsoft Intune MDM Device CA" certificate? #258

Open forderud opened 11 months ago

forderud commented 11 months ago

Hi. I'm evaluating feasibility of using the Microsoft Graph APIs to develop an alternative to the "Company Portal" app with custom UI. One sub-problem to then tackle is device authentication.

InTune appear to be automatically create a Microsoft Intune MDM Device CA certificate for client authentication when enrolling: image

I'm assuming that "InTune Management Extension" and "Company Portal" already uses this InTune certificate to authenticate the device, so that they can afterwards query for available SW packages specific for just that particular machine. I am seeking advise on how to implement the same functionality myself.

It's possible to semi-solve the problem by creating an Azure app as described on How to use Azure AD to access the Intune APIs in Microsoft Graph. Then, one can upload the public key for the InTune certificate for all relevant machines to the Azure app. However, that approach suffer from several shortcomings:

Any advise on how to authenticate the DEVICE using the InTune certificate, without having to upload the public key to an Azure app?