Hello all,
what should be the HTTP query to retrieve the login activity of a specific user?
My app is authorized in AAD as follows,
The audit log is also enabled.
Hi @HouJun ,
try,
GET - https://graph.microsoft.com/v1.0/users/{user-id}/licenseDetails
put the user-id inside the brackets.
For the request you need one of the follwing permissions:
Kind regards.
HI,Expiscornovus
Do you know how to get the license information owned by a specific user from AAD?
If you know, please tell me.
Thanks
I've deleted the HTTP Action and set it up again, now it works.
Thanks for your ambitions.❤️
Now you have a new follower 😋
Hi @ektoplasma24,
Just tested the signinActivity resource one. If it helps below is my setup and my test result. So, in theory it should work for you as well. Just need to find what is different in your setup.
Below is my test setup.
2. My test result
Hi @ektoplasma24,
There is a lot more to troubleshoot. For example, what type of authentication have you configured in the Authentication settings of the HTTP action?
Since you were talking about an App, I assume you are using OAuth in the HTTP action configuration?
Have you double checked you are using the correct client id, client secret, tenant id, etc.?
I've got the same error as in the last post.
I only would like to know when the user has logged in the last time.. seems to be difficult 😂
Hi, @Expiscornovus,
thanks for your help, I think there is not much left to solve this puzzle. 😄
I got another error, I think that is because I was not registered as an app owner. - changed that now.
Subsequently, I've triggered the workflow again unfortunately without success the error remains...
URL is now,
https://graph.microsoft.com/beta/users/6da38f53-ff1d-445b-8a06-262cc******/?$select=displayName,userPrincipalName,signInActivity
Error message,
{
"error": {
"code": "Authentication_MSGraphPermissionMissing",
"message": "Calling principal does not have required MSGraph permissions AuditLog.Read.All",
"innerError": {
"date": "2023-01-10T17:13:05",
"request-id": "bf8158c3-bee3-40d8-8941-f3456011a25d",
"client-request-id": "bf8158c3-bee3-40d8-8941-f3456011a25d"
}
}
}
Hi @ektoplasma24,
And in case you are talking about audit logs signIns, you could use the below. I really need some coffee 😅
https://graph.microsoft.com/v1.0/auditlogs/signIns?$filter=userId eq 'youruserid'
Hi @ektoplasma24,
Apologies for the confusion. I forgot it is a beta method and the property is called signInActivity, not signIn:
Try something like below:
https://graph.microsoft.com/beta/users/youruserid/?$select=displayName,userPrincipalName,signInActivity
Michael E. Gernaey
497
Super User 2025 Season 2
David_MA
436
Super User 2025 Season 2
Riyaz_riz11
244
Super User 2025 Season 2