0

I am using microsoft graph api to access groups in azure active directory, I have created 2 groups in AAD named OIC and other named as testing

enter image description here

When I test using microsoft graph explorer, URL that I use

GET https://graph.microsoft.com/v1.0/groups

Response:

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups",
    "value": []
}

Why do I get empty value for groups even though I have groups in AAD.

I have logged in as admin user. enter image description here

bippan
  • 239
  • 1
  • 2
  • 11
  • Please let us know Whether you are able to get the data using PowerShell Get-AzureADGroup – Sruthi J Sep 29 '20 at 12:22
  • Can you please share a screenshot of your graph API while running in explorer and please follow the guideline given this [document](https://learn.microsoft.com/en-us/graph/api/group-list?view=graph-rest-1.0&tabs=http) – Sruthi J Sep 29 '20 at 13:09
  • @SruthiJ-MSFTIdentity I have added a screenshot. – bippan Sep 29 '20 at 13:48
  • Thank you for posting for the screenshot. I created newly created groups, tested with Graph explorer and it works for me. can you please provide logs/timestamp of your graph logs and also please check in the postman – Sruthi J Sep 29 '20 at 15:53

1 Answers1

0

It seems that you have created groups in a tenant which is not your home tenant.

It means credentials are only owned by a single tenant. The tenant is discovered by Graph Explorer based on domain. You cannot use Graph Explorer to query tenants your account is a guest on, it can only query the tenant that owns the account. It retrieves data from the tenant you (or your app) authenticated against. It cannot query across multiple tenants.

The only way to use those creds with another tenant would be to force the OAuth uri to use that tenants ID instead of common. This isn't supported by Explorer. You'd have to download the source an reengineer the auth process.

Reference SO thread: https://stackoverflow.com/questions/53341544/how-can-i-change-default-tenant-in-microsoft-graph-explorer#:~:text=If%20you%20want%20to%20sign,use%20tenant%20query%20string%20parameter.&text=A%20simple%20url%20to%20go,or%20tenantId%2C%20both%20work).

Harshita Singh
  • 4,590
  • 1
  • 10
  • 13