Microsoft's recent guidance on device-code phishing highlights an awkward problem: device-code authentication is legitimate, but attackers can abuse the trusted flow by persuading users to authorize a session. For Microsoft 365, are you blocking device-code authentication for everyone, or allowing narrowly scoped exceptions for Teams Rooms, Teams Phones, shared devices, Linux or CLI workflows, IoT devices, and similar cases? I'm also interested in whether you monitor device-code sign-ins after authentication, rather than relying only on Conditional Access to block the flow.
4 Answers
For Teams Phones, device-code flow is not always technically required, but the alternative login path can expose a registration-versus-compliance chicken-and-egg problem. A phone may need to contact the Teams service before it exists in the directory, so a device filter cannot reliably exempt it during initial registration. Test the direct sign-in path carefully, and if it fails, use a dedicated exception with the smallest possible scope rather than weakening the policy for all Microsoft 365 access.
The usual baseline is to block device-code authentication for all users and applications, then create a tightly controlled exception group only when a real dependency exists. Keep the group as small as possible, scope access to the required resources, restrict locations or networks where practical, and review the membership regularly. For temporary administrative or migration needs, a separate Privileged Identity Management-eligible group can make the exception time-limited and require strong authentication.
That works well for most services, but some hardware and registration workflows still make the exception larger than expected. The important part is treating every exception as a documented dependency rather than leaving device-code access broadly enabled.
Teams Rooms and similar shared devices are commonly handled with a dedicated exclusion group containing only the required resource accounts. If the devices are permanently located in known offices, add location or network restrictions and monitor their sign-ins. For services such as Linux server onboarding or CLI tools, use separate non-user accounts where possible and limit them to the specific resources and networks they need.
Some Teams Phones can avoid device-code flow by choosing the less obvious option to sign in directly on the phone with a username, password, and MFA. However, Conditional Access requiring a compliant or hybrid-joined device can break that registration because the phone is not registered yet. That creates a practical choice between allowing device code for those devices or making a narrowly scoped exception to the compliance requirement.
Don’t rely on Conditional Access alone. Review sign-in logs for device-code authentication, especially for exception accounts, and alert on unexpected users, locations, applications, or resources. Access reviews, sign-in risk policies, strong MFA, network restrictions, and short-lived administrative exceptions can help reduce the chance that an exception becomes a permanent blind spot.

The default device-code experience can also hide the direct sign-in option, and some phone models have limited passwordless support. That makes user experience a real factor, but it still doesn’t justify permitting device-code authentication from unmanaged internet devices without additional controls.