Check the sign-in
No approved device-code workflow matched the sign-in.
View query
Q-01Compare device-code authentication with expected identity context
What this checks
Establish the authentication context before deciding whether a successful device-code grant was routine or unauthorized.
KQL
AuthenticationLogs
| where Account == "riley.chen@example.com"
| where GrantType == "device_code"
| project Timestamp, Account, SourceIp, ApplicationId, SessionContextIdSPL
| datamodel Authentication Authentication search
| search Authentication.user="riley.chen@example.com" Authentication.authentication_method="device_code"
| rename Authentication.* AS *
| table _time user src app session_idWhat to look for
A matching grant with enough identity and session context to support a controlled follow-on correlation.
Technical details
Tested signal
A device-code authentication that differs from the user's approved workflow and managed-device context.
Assumptions
- Authentication records are complete for the bounded scenario window.
- Account and session-context fields are normalized consistently in this source.
Data requirements and relevant fields
- authentication
Device-code authentication events with identity, application, source, and session context.
TimestampAccountSourceIpGrantTypeApplicationIdSessionContextId
KQL schema
AuthenticationLogs and its grant, application, and session fields are illustrative mappings.
SPL schema
The Authentication data model can normalize common identity fields, but device-code and session_id require source-specific field aliases.
Limitations
- A missing approved workflow record does not prove that the user did not intentionally authenticate.
- Authentication telemetry alone cannot establish what a session later accessed.
Both variants test the same authentication context. Device-code and session fields require source-specific normalization.
More reasoning
Observation
A successful device-code authentication originated outside the user's expected managed-device context.
Working explanation
The user may have intentionally completed a legitimate command-line or limited-input authentication workflow.
What was checked
Compare the authentication event with the identity inventory and approved workflow context.
Interpretation
The mismatch justified further review, but a successful authentication and context difference did not prove token theft or unauthorized use.
The expected workflow review weakened the routine-authentication explanation while leaving legitimate but undocumented activity plausible.