Hello @Hitesh and thanks for reaching out. In order to read a user using the username you have to call the AAD-UserReadUsingAlternativeSecurityId or AAD-UserReadUsingAlternativeSecurityId-NoError technical profile. Input claim is alternativeSecurityId
. E.g.
<TechnicalProfile Id="AAD-UserReadUsingAlternativeSecurityId">
<Metadata>
<Item Key="Operation">Read</Item>
<Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
<Item Key="UserMessageIfClaimsPrincipalDoesNotExist">User does not exist. Please sign up before you can sign in.</Item>
</Metadata>
<InputClaims>
<InputClaim ClaimTypeReferenceId="alternativeSecurityId" PartnerClaimType="alternativeSecurityId" Required="true" />
</InputClaims>
<OutputClaims>
<!-- Required claims -->
<OutputClaim ClaimTypeReferenceId="objectId" />
<!-- Optional claims -->
<OutputClaim ClaimTypeReferenceId="userPrincipalName" />
<OutputClaim ClaimTypeReferenceId="displayName" />
<OutputClaim ClaimTypeReferenceId="otherMails" />
<OutputClaim ClaimTypeReferenceId="givenName" />
<OutputClaim ClaimTypeReferenceId="surname" />
</OutputClaims>
<IncludeTechnicalProfile ReferenceId="AAD-Common" />
</TechnicalProfile>
Regarding MS Graph you need to filter by the identities
properties. E.g.
GET https://graph.microsoft.com/v1.0/users?$filter=identities/any(x:x/issuerAssignedId eq 'username')
Let us know if you need additional assistance. If the answer was helpful, please accept it and complete the quality survey so that others can find a solution.