Query related on Microsoft Azure Active Directory users information retrieval using web/desktop application

Ravichand Agolla 1 Reputation point
2022-03-04T05:46:42.527+00:00

Hi,

We have both java and c++ desktop application, from that we want to retrieve all the users from Azure Active Directory. I have gone through links which available in Microsoft documentation but didn't get clarity about the approach. Could you please throw some insights on this? Thanks in Advance.

Thanks,

Ravichand

Microsoft Security Microsoft Entra Microsoft Entra ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 30,296 Reputation points Microsoft Employee Moderator
    2022-03-08T15:06:01.317+00:00

    Hi @Ravichand Agolla ,

    Thanks for reaching out and apologies for delay in response.

    From you query I understand that from your desktop application you want to integrate with Azure Active Directory to get information about all the users.

    As mentioned below ,You need to register your desktop application in Azure Active Directory to sign in to acquire the access token to call Microsoft Graph API which leverage the user's information on Azure AD.
    181010-img1.png

    1. First you need to register the application in Azure AD and manually configure your application

    181056-img3.png

    2.Under Manage, select Authentication and Add a platform > Mobile and desktop applications

    181092-img2.png

    The app registration process generates an application ID, also known as the client ID, which uniquely identifies your desktop app to configure in the application.

    Microsoft provide the MSAL (Microsoft.Identity.Client) libraries used to sign in users and after the user is authenticated, the application receives a token which you can use as bearer token to pass in Authorization Header to query Microsoft Graph API to get user’s information by calling below Graph endpoint.

    https://graph.microsoft.com/v1.0/users/{id | userPrincipalName}.

    Reference doc: https://learn.microsoft.com/en-us/azure/active-directory/develop/scenario-desktop-overview
    https://learn.microsoft.com/en-us/azure/active-directory/develop/desktop-app-quickstart?pivots=devlang-windows-desktop

    If you have any further queries on this. Please let us know.

    Thanks,
    Shweta


    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.