get user/group role id by appid and user object id

Tibadaya, Nirbhay 21 Reputation points

I have registered the app with Azure AD and created some of the roles for user and group.

Now, How can I get user/group role id by userid/userprincipal?

Through below endpoint Im getting all roles listed for my application.<appId>/appRoles/

Azure Active Directory
Azure Active Directory
An Azure enterprise identity service that provides single sign-on and multi-factor authentication.
13,684 questions
Microsoft Graph Groups API
Microsoft Graph Groups API
A Microsoft API that creates and manages different types of groups and group functionality.
190 questions
Microsoft Graph Applications API
Microsoft Graph Applications API
A Microsoft API that enables you to manage these resources and actions related to applications in Azure Active Directory.
507 questions
Microsoft Graph Users API
Microsoft Graph Users API
A Microsoft API that allows you to build compelling app experiences based on users, their relationships with other users and groups, and the resources they access for example their mails, calendars, files, administrative roles, group memberships.
653 questions
No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 20,956 Reputation points

    Hi @Tibadaya, Nirbhay

    You can use this api to list all users or groups assigned to the enterprise application:{object id of the app}/appRoleAssignedTo

    Alternatively, you can retrieve a list of app roles that have been assigned to a specific user or group based on the object ID of the user/group.

    GET /users/{id | userPrincipalName}/appRoleAssignments
    GET /groups/{id}/appRoleAssignments

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

0 additional answers

Sort by: Newest