Vote count:
0
I am using the GraphHelper Library (http://ift.tt/13d58pH) to obtain user details from Azure AD. However, I am strugging to get the approles information, it just returns an Unauthorised (I have all access rights).
Code:
public static async Task<List<AzureAppRole>> GetApplications(User user)
{
var appRoles = new List<AzureAppRole>();
var userFetcher = user as IUserFetcher;
IPagedCollection<IAppRoleAssignment> rawObjects = await userFetcher.AppRoleAssignments.ExecuteAsync();
do
{
List<IAppRoleAssignment> directoryObjects = rawObjects.CurrentPage.ToList();
foreach (IAppRoleAssignment dobject in directoryObjects)
{
if (dobject is AppRole)
{
var u = (AppRole)dobject;
appRoles.Add(new AzureAppRole
{
DisplayName = u.DisplayName,
ObjectId = u.Value
});
}
}
rawObjects = rawObjects.GetNextPageAsync().Result;
} while (rawObjects != null && rawObjects.MorePagesAvailable);
return appRoles;
}
asked 1 min ago
Obtaining a users Application access from Azure Graph API
Aucun commentaire:
Enregistrer un commentaire