1
votes

I was following an Adrian Hall Tutorial for custom authentication, I've followed the tutorial step by step, but i havent been able to retrieve the Groups Claim from that tutorial?

I had used postman and instead of recieving 18 claims as the tutorial said, i only get 11, no matter what i do, even though i had changed the manifest as the tutorial said but still, I havent been able to get it.

Is Adrian Hall Tutorial wrong? https://adrianhall.github.io/develop-mobile-apps-with-csharp-and-azure/chapter2/authorization/

2

2 Answers

2
votes

As Erik mentioned that the groups claims is only available for the Azure AD at present.

However, we can using the Azure AD Graph to query the group memberships. Register an app for query Azure AD Graph and access the token using the clietn credentials flow. Here is the request for your reference:

POST:https://graph.windows.net/{tenantId}/users/{objectId}/getMemberGroups?api-version=1.6
authorization: bearer {access_token}
content-type: application/json

{
    "securityEnabledOnly": false
}