Forum Cross Platform with Xamarin
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Identify the AAD group claims in xamarin forms app

I am using cross platform xamarin app. Implemented the AAD using dependency service. AAD returns me the access token but doesn't returning the group principle claims.

Using below code to get Claims in Android dependency service.

authResult = await authContext.AcquireTokenAsync(graphResourceUri, ApplicationID, uri, new PlatformParameters((Activity)Forms.Context));
var userPrincipal = new WindowsPrincipal(new WindowsIdentity(authResult.UserInfo.DisplayableId));
var value = userPrincipal.IsInRole("GroupName");
var claims = userPrincipal.Claims;
it returns claims count 0.
Please help me to resolve this.


  • jezhjezh Member, Xamarin Team Xamurai

    Could you please post the main code or a basic demo?

  • bluebirdbluebird USMember ✭✭
    Thanks jezh,
    Resolved this issue by calling the RESTApi call by passing the tenant id.
Sign In or Register to comment.