Graph API | ADB2C last sign in

Abhay Chandramouli 1,056 Reputation points
2023-04-06T05:49:12.02+00:00

Hi I am trying to fetch the last sign in of the user from adb2c using MS Graph API from this doc https://learn.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#example-10-get-users-including-their-last-sign-in-time I am unable to get the signInActivity field from graph response

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

2 answers

Sort by: Most helpful
  1. CharanyaB-MSFT 1,891 Reputation points
    2023-04-06T06:10:58.7666667+00:00

    Hello @Abhay Chandramouli,

    Thanks for reaching out!

    When you specify $select=signInActivity or $filter=signInActivity while listing users you will get the SignInActivity property. You can also use https://graph.microsoft.com/v1.0/users/{user-id}?$select=signInActivity,displayName API to get the signInActivity of a particular user. Please refer the below screenshot: User's image

    Also, make sure AuditLog.Read.All permission is consented to get signInActivity details.

    Hope this helps.

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


  2. Abhay Chandramouli 1,056 Reputation points
    2023-04-06T08:34:24.6433333+00:00

    (The user should have signed in atleast once to fetch this object) To retrieve the SignInActivity property when listing users, you can use the $select=signInActivity or $filter=signInActivity parameter. Additionally, you can obtain the signInActivity of a specific user by utilizing the https://graph.microsoft.com/v1.0/users/{user-id}?$select=signInActivity,displayName API. Please refer to the screenshot below for more information:
    User's image

    Also, make sure AuditLog.Read.All permission is consented to get signInActivity details.

    0 comments No comments

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.