Having assigned the User.Read.All permission to a SPFx web part, and Approving it in SPO Admin portal, and also making it a Configured permission (and consenting) it in AD App registration, I'm still not able to query properties such as companyName or postalCode or a Guest user, they always come back as null.
I'm using pnp-js to do the query, but same happens if I import the HTTP call to Postman and do the query manually, so there's nothing wrong (apparently) in the call: https://graph.microsoft.com/v1.0/users/first.last_domain.com%23EXT%23%somecompany.onmicrosoft.com?$select=id,companyName,displayName,givenName,surname,mail,postalCode
Do I need some additional permission to query non-basic Guest user profile properties?
I don't think it is related to permission, I think
User.Read.All
permission is enough. I test it in my side, it works fine. So please check if the two fieldscompanyName
andpostalCode
of the ad guest user is null on your azure portal.Just guess your situation: Did you add the user from another tenant to current tenant as a guest user ? If so, in current tenant, it will not show the fields such as
companyName
andpostalCode
which shown in original tenant.