Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How should I get last login timestamp of Azure AD B2C user?

I need to get below details of Azure AD B2C users -

  • Created Date user account
  • Last Login
  • User is Active or De-active

I have explored Azure AD graph API (Get-User) but it throws some exception. https://learn.microsoft.com/da-dk/azure/active-directory-b2c/active-directory-b2c-devquickstarts-graph-dotnet

Still I am not sure that, above information will get from Azure AD B2C graph API or not.

Is there any other way to get the above Azure AD B2C user details?

like image 354
Hemlata Tripathi Avatar asked Nov 19 '22 06:11

Hemlata Tripathi


1 Answers

The below API will provide the response

'https://graph.microsoft.com/beta/users?$select=displayName,signInActivity

              {
                  "displayName":  "test",
                  "id":  "bf7a60-3db4-4943-8d45-a7de9276c"
              },
              {
                  "displayName":  "Admin",
                  "id":  "ae1f1dd6-886a-484b-b46e-e48cce4",
                  "signInActivity":  "@{lastSignInDateTime=2021-03-15T14:06:21Z; lastSignInRequestId=55909a8c-2c13-4e5a-8e23-8952571a0300}"
              },
like image 98
Sushena Avatar answered Dec 27 '22 15:12

Sushena