abhinav3414
abhinav3414

Reputation: 967

Retrieve Applications per user in Microsoft Graph

I want to get list of enterprise applications assigned to a user in Azure AD (not servicePrincipals), Is there a direct API to do so, right now I am using below steps to get application details?

Right now,

  1. I am using /users/{userId}/appRoleAssignments API to get servicePrincipals assigned to user and
  2. then doing a call to get application details(application id) of an app using ServicePrincipal API : /servicePrincipals?$filter=id eq servicePrincipalId-1 or id eq servicePrincipalId-1.
  3. After these above steps I am getting application details using API : /applications?$filter=appId eq 'someAppId' or appId eq 'someAppId2'

Upvotes: 0

Views: 714

Answers (1)

RamaraoAdapa
RamaraoAdapa

Reputation: 3119

Enterprise Applications in Azure AD have the service principals associated to them.

When we use graph API to fetch applications assigned to user using /users/{userId}/appRoleAssignments, will return the service principal id of that enterprise application. It won’t return the application ID.

The steps you are following is the only way to get the application details.

Upvotes: 1

Related Questions