graph explorer user attibutes null

Frank 6 Reputation points
2022-11-18T16:10:12.543+00:00

I'm logged into graph explorer as an admin user. I think I've granted the necessary permissions in order to read/see the data I want to see. If I click on the "Modify permissions" tab the User.Read and User.ReadWrite are in a status of Unconsent. When I try an execute https://graph.microsoft.com/v1.0/me the only populated data I get back is the "id" and "userPrincipalName". Everything else is null.

Also tried https://graph.microsoft.com/v1.0/users/<object_id> but got the same results.

Just want to be able to read the data that's currently being returned as null. While not all of the data is set some of it is.

Side note if I enter garbage for the <object_id> it still seems to return my user data i.e. id and userPrincipalName

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. HarmeetSingh7172 4,826 Reputation points
    2022-11-18T22:26:28.11+00:00

    Hello @Frank

    Thanks for reaching out!

    I'm unable to reproduce this issue using my test tenant. I'm getting expected set of results in API response.

    User.Read permission allows users to sign-in to the app and allows the app to read the profile of signed-in users. It also allows the app to read basic company information of signed-in users.

    User.ReadWrite allows the app to read the signed-in user's full profile. It also allows the app to update the signed-in user's profile information on their behalf.

    Please follow this Get a User document to know least to most privileged permissions needed to run the /me or /users/{id | userPrincipalName} endpoint. Also do refer this Graph Permissions documentation to understand user resource related permissions.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.


  2. Zehui Yao_MSFT 5,876 Reputation points
    2022-11-21T03:40:04.56+00:00

    Hi @Frank , I test locally using my admin user, and it both worked fine in explorer and postman with the permission User.Read.

    Other suggestion I can offer is to try using the User.Read.All permission which will give you permission to read the entire property set of a user. This will require Admin Consent from a tenant admin before you can use it.

    Or as mentioned in the official documentation, there may be some delays. Hope that can help you. Best wishes.
    262395-image.png
    262405-image.png
    262269-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. Shweta Mathur 30,296 Reputation points Microsoft Employee Moderator
    2022-11-21T03:59:47.05+00:00

    Hi @Frank ,

    Thanks for reaching out.

    I understand you are trying to get the user's details using Graph Explorer and getting only id and userPrincipalName.

    I tried to replicate the issue at my end and able to get the user's details which are set for admin and is visible in portal as well.

    I have the following permissions in my Graph Explorer which can been consented earlier.

    262256-image.png

    and able to get the details as shown below

    262257-image.png

    v1.0 endpoint will not show those details which has not been set for the user.

    I also tried to retrieve the user's details by providing object id of the admin in Graph Explorer and got same results:

    262407-image.png

    However, providing any garbage details in object -id is giving me the error:

    262337-image.png

    Could you please confirm, are you getting null value in the attributes, or you are not getting the attribute as well.

    v1.0 endpoint will not provide the attributes if values are not set, and beta endpoint will give null value for those attributes.

    "employeeId": "ABC123",  
    "employeeHireDate": null,  
    "employeeLeaveDateTime": null,  
    "employeeType": null,  
    "faxNumber": null,  
    

    Are you facing the same issue from beta endpoint https://graph.microsoft.com/beta/me as well.

    If you are still facing the issue, please share the screenshot of the issues which will help us to troubleshoot and understand the issue better.

    Hope this will help.

    Thanks,
    Shweta

    ---------------------------------------

    Please remember to "Accept Answer" if answer helped you.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.