How to get logs using Graph API for invalid usernames attempt?

I’m trying to get logs for invalid username attempts using Graph API, by calling this endpoint:
https://graph.microsoft.com/v1.0/auditLogs/signIns

For example, I’m sending a request to “https://login.microsoftonline.com/organizations/oauth2/v2.0/token” to generate a token using grant_type=password, but I’m using a username from a non-existent user, that does not exist in our tenant. Microsoft returns to me:

AADSTS50034: The user account {EmailHidden} does not exist in the domain.com directory. To sign into this application, the account must be added to the directory.rnTrace ID: {GUID}rnCorrelation ID: {GUID}rnTimestamp: {TIMESTAMP}

But this specific error does not show up on:
https://graph.microsoft.com/v1.0/auditLogs/signIns?$filter=correlationId eq '{GUID}'.

This metric is important for us to know if the users are using our system correctly.

Can I use another Graph endpoint to extract this information or it’s a limitation from AzureAD?

Thanks and appreciate all kind of advice.

I have one Azure AD application named GraphAug with API permission as below:

enter image description here

When I tried to generate access token by passing username from a non-existent user via Postman, I too got same error:

POST https://login.microsoftonline.com/organizations/oauth2/v2.0/token
client_id:appId
grant_type:password
scope: https://graph.microsoft.com/.default
username:[email protected]
password:xxxxxxxxx

Response:

enter image description here

Now, I ran below query in Graph Explorer by filtering with correlation_id and got blank results same as you:

GET https://graph.microsoft.com/v1.0/auditLogs/signIns?$filter=correlationId eq '{GUID}'

Response:

enter image description here

Note that, you can only fetch successful and failed sign-in attempts of existing users in that tenant by running this query: https://graph.microsoft.com/v1.0/auditLogs/signIns

When I tried to generate access token by passing username from a existing user with wrong password via Postman, I got different error saying invalid username or password:

POST https://login.microsoftonline.com/organizations/oauth2/v2.0/token
client_id:appId
grant_type:password
scope: https://graph.microsoft.com/.default
username:[email protected]
password:xxxxxxxxx

Response:

enter image description here

You can extract this log information of existing user by running below query in Graph Explorer, filtering with correlation_id:

GET https://graph.microsoft.com/v1.0/auditLogs/signIns?$filter=correlationId eq '{GUID}'

Response:

enter image description here

To confirm that, I checked the same in Portal where the logs are same as below:

enter image description here

Alternatively, you can raise support ticket with Microsoft and share correlation_id with them to get more details of that specific error logs.

Recognized by Microsoft Azure Collective

1

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật