I am using a Blazor app with AzureAD for authentication. This works well and i am able to look at roles and restrict access according to roles.
I have an app with a form that contains user fields, and I want to validate the user field against a list of the AD users.
How do I do this? From what I understand i would need to use the Ms GRaph API to get a list of users that I can then bind to my dropdowns in the form (Not in Database since AzureAD does not implement the .Net security schema)? How do I do this, do you have an example with getting the list of declared app users from Graph API in Azure?
Hi @philippe,
Indeed you need to use the MS Graph API to get all users. We currently don't have an example how to do that. You can try searching online though. I found this which seems promising: List users - Microsoft Graph v1.0 | Microsoft Learn
Was curious myself, but would like our on prem SQL server to do it, so I asked Bing Chat -
"To retrieve data from Azure AD using an on-premises SQL Server, you can follow these general steps:
-
Set up Azure AD Connect: This involves installing and configuring Azure AD Connect to enable synchronization of user identities between the on-premises Active Directory environment and Azure AD.
-
Set up Azure AD Connect Health: This involves installing and configuring Azure AD Connect Health to enable monitoring and reporting capabilities for the on-premises Active Directory environment.
-
Configure SQL Server: This involves configuring the SQL Server to enable connectivity to Azure AD. This can be done using the Active Directory - Universal with MFA support authentication method.
-
Query Azure AD from SQL Server: Once the SQL Server is configured, you can use SQL Server Management Studio or other tools to query Azure AD and retrieve user identity and access data.
It is important to note that the specific steps involved in retrieving data from Azure AD using an on-premises SQL Server may vary depending on the specific requirements and configurations of your environment. It is recommended to consult Microsoft documentation or seek the assistance of a qualified IT professional for guidance on this process."