Azure AD:Authenticate Devices

I have a project where there are thousands of devices running android apps on our LAN. Those apps need to reach out to services. I’d like to authenticate the applications against Azure AD and then validate the tokens on the server side. There will be no user involved we just want to authenticate the device itself.

What are some recommended best practices in this scenario? We can do client credential grants from the android app against the cloud but then we’d need to provide the clientid/secret to the APK and I don’t like the idea of storing a secret in the APK because it can be decompiled. I think you can do a Client Credential grant without a secret, but that seems like a pretty loose authentication mechanism.

I read that Azure AD supports certificate based authentication but I think functionally the same problem exists there, whereas we need to install a certificate on the device and if someone gets access to the device they can gain access to the certificate.

What can be done in this scenario?

Recognized by Microsoft Azure Collective

0

Note that: Client credential flow by default requires client Id and client secret or certificate.

  • In the Client Credentials flow, the application users its client ID and client secret to the authorization server (Azure AD) to obtain an access token.
  • These credentials verify the identity of the application to the server, ensuring that only authorized applications can obtain tokens.
  • Hence client Id and client secret are mandatory.

Otherwise, you can make use of Azure AD Managed Service Identity (MSI) that allows applications running on Azure to authenticate with Azure AD without passing any secrets or certificates if it suits your setup/scenario.

  • Managed Identity cannot be used for authenticating applications that run locally. It is designed to be used only for applications deployed on Azure services that support Managed Identity.
  • Azure Services like Azure Kubernetes Service, Azure Virtual Machine, and Azure Container Instances.
  • If your application is hosted on one of these services, you can make use of MSI. Refer this MsDoc

You can assign application permissions to the managed identity by using the PowerShell script:

$serverApplicationName = "AppName"
$serverServicePrincipal = (Get-MgServicePrincipal -Filter "DisplayName eq '$serverApplicationName'")
$serverServicePrincipalObjectId = $serverServicePrincipal.Id
$appRoleName = "test.read"
$appRoleId = ($serverServicePrincipal.AppRoles | Where-Object {$_.Value -eq $appRoleName }).Id

$managedIdentityObjectId = "MIObjectID"
New-MgServicePrincipalAppRoleAssignment -ServicePrincipalId $serverServicePrincipalObjectId  -PrincipalId $managedIdentityObjectId -ResourceId $serverServicePrincipalObjectId -AppRoleId $appRoleId

Permissions are granted to the managed identity:

  • Then try to authenticate using this MSI client Id.
  • If MSI do not suit your setup or requirement then, try storing the secrets in Azure Key Vault and retrieve it while using client credential flow to authenticate.
  • Refer this MsDoc
Recognized by Microsoft Azure Collective

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật