A cloud-based identity and access management service for securing user authentication and resource access
Hey Lucas, it sounds like your device code flow block policy simply wasn’t enforced for that particular sign-in. In Microsoft Entra ID Conditional Access is only evaluated when a token is issued, so if the policy didn’t apply at the moment of token issuance (or if an existing refresh token was reused) you’ll still see a “successful deviceCodeFlow” entry even though you think you’ve blocked it globally.
Here’s what to check:
- Review the Conditional Access tab in the sign-in log
- Go to Entra ID > Sign-in logs > select that 3/13/2026 event > Conditional Access.
- See if your “Block device code flow” policy shows as Applied, Not applied or Excluded – and note the reason.
- Confirm policy scope and state at that timestamp
- Was the policy set to Enabled (not Report-only)?
- Does it include All users (or the compromised user) and All cloud apps (or the target app)?
- Are there any exclusions (users, groups, or emergency/break-glass accounts)?
- Check client app settings
- Under Conditions > Client apps, ensure “Other clients” (where device code flow lives) is covered.
- Look for a pre-existing refresh token
- If the user had a valid refresh token issued before you enabled the block, CA won’t re-evaluate until that token expires.
- In the log’s Basic info, check “Original transfer method” vs. “Authentication Protocol” to see if this was a protocol-tracked refresh.
- Simulate with the What If tool
- In Entra ID > Conditional Access > What If, select the user/app and the Device code flow condition to confirm whether your policy would block it.
- Remediate & harden
- Revoke the user’s refresh tokens (Azure AD admin center > Users > revoke sessions).
- Reset their password and re-enroll MFA to force fresh authentication under your CA rules.
Follow-up questions to narrow it down:
- In the CA tab for that sign-in, what enforcement state and reason did you see for your device code flow policy?
- Was the policy in “Enabled” mode (not report-only) and targeting “Other clients” at the time?
- Are there any break-glass or emergency accounts excluded that might include this user?
- Have you observed other deviceCodeFlow successes, or was this a one-off?
Reference list
- Troubleshoot Conditional Access policies: https://learn.microsoft.com/entra/identity/conditional-access/troubleshoot-conditional-access
- Block authentication flows with CA policy (device code flow): https://learn.microsoft.com/entra/identity/conditional-access/policy-block-authentication-flows?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider#overview
- Conditional Access authentication flows concept: https://learn.microsoft.com/entra/identity/conditional-access/concept-authentication-flows?wt.mc_id=knowledgesearch_inproduct_azure-cxp-community-insider
- Sign-in logs in Microsoft Entra ID: https://docs.microsoft.com/azure/active-directory/reports-monitoring/concept-sign-ins
- What If tool for Conditional Access: https://learn.microsoft.com/entra/identity/conditional-access/what-if-tool
Hope this helps you pinpoint why that login bypassed your block!
Note: This content was drafted with the help of an AI system. Please verify the information before relying on it for decision-making.