question

SmithStuart-2542 avatar image
0 Votes"
SmithStuart-2542 asked SmithStuart-2542 commented

Use Graph API to get the Active directory group of other users

Hi there,

I have an PowerApps application and I need to be able to check the Active Directory Group IDs of any employee that is searched for and selected within the application.
So that the user interface can be configured based on the selected employee's AD group memberships.
We already user a standard officeusers connector to get many employee details.
However AD groups ID are need to maintain specific lists of employees, whom are eligible for different configurations in the app.

I want to use a similar approach as mentioned in this guide for implmenting role based security https://powerapps.microsoft.com/en-us/blog/implementing-role-based-permission/

I have tested this but it will only fetch the AD groups of the logged in user. not for any employee.

is there a way to use the Graph APi to do this?

or is there an alternate way? fundamentally i just need to be able to maintain lists of employees can cal be called effeciently. SharePoint lists are too slow. AD groups are best as these are already maintained by the organisation.


microsoft-graph-applications
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DianaWanjuhi-1579 avatar image
0 Votes"
DianaWanjuhi-1579 answered SmithStuart-2542 commented

Hello @SmithStuart-2542 in your case, you can use application permissions instead of delegated for your application. This would allow your application to call list memberOf passing in the specific employee's user ID or UPN, check for membership and configure the UI based on the employee's group memberships.

Please let me know if this is what you were looking for,

Diana.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi there,
this does sound good! :) i have the correct permissions set.

forgive me I am very new to this and simply following the instructions in the guide https://powerapps.microsoft.com/en-us/blog/implementing-role-based-permission/

do you know how woudl I write this call in Power Apps? Currently i am writing the following code in power apps.... (which is failing with permission issue):

ClearCollect(Test, Graph_1.ListUserGroups(NomineeSearch_ComboBox.Selected.Mail).value)


Would I first need to write "list MemeberOf" call into the GraphAPI JSONfile i loaded to register the connector? (see attached)

Thank you :)






















[1]: /answers/storage/attachments/88193-graphapi.txt

0 Votes 0 ·
graphapi.txt (10.8 KiB)