有没有办法使用 Graph API 调用来检索 appRoleName?

Is there way to retrieve appRoleName using Graph API call?

我正在使用 Microsoft Graph API 为用户获取 AppRoles。响应包含 AppRoleId 但不包含 AppRoleName。有办法实现吗?

调用下面的图表 API 请求通过 Postman 获取为特定用户定义的角色。根据 Microsoft 文档申请权限 https://docs.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

根据你提供的截图,你得到了resourceId,那么你只需要使用resourceId得到appRoles,然后根据找到对应的appRoleName你的 appRoleId.

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