R0106
R0106

Reputation: 43

Is there way to retrieve appRoleName using Graph API call?

I am using Microsoft Graph API to get AppRoles for user. Response contains AppRoleId and does not contain AppRoleName. Is there a way to achieve this?

Calling below Graph API request to get Roles defined for specific user through Postman. Apply Permission as per Microsoft document https://learn.microsoft.com/en-us/graph/api/user-list-approleassignments?view=graph-rest-1.0&tabs=http

#HTTP request 
GET /users/{id | userPrincipalName}/appRoleAssignments

enter image description here

Upvotes: 3

Views: 1893

Answers (1)

Carl Zhao
Carl Zhao

Reputation: 9559

According to the screenshot you provided, you have got the resourceId, then you only need to use the resourceId to get appRoles, and then find the corresponding appRoleName according to your appRoleId.

Get https://graph.microsoft.com/v1.0/servicePrincipals/{your resourceId}

enter image description here

Upvotes: 4

Related Questions