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.

Answers

  • 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.