#Devicecode
To check if it is in use, you can filter sign-in logs to Authentication protocol - Device code, or you can run Graph PowerShell: Get-MgBetaAuditLogSignIn -Filter "AuthenticationProtocol eq 'deviceCode'"

I usually recommend an exclusion group managed by PIM or Access Packages :)
June 18, 2026 at 3:18 AM

You can assess impact via Entra sing-in logs (see picture) or Graph PowerShell:

Get-MgBetaAuditLogSignIn -Filter "AuthenticationProtocol eq 'deviceCode'"

CA template (Use Upload policy file in CA) here:
github.com/nathanmcn...

Volexity report: www.volexity.com/blo...
February 14, 2025 at 1:11 AM
2. Did you already try using device codes?
```powershell
Connect-ExchangeOnline -DeviceCode
Connect-MgGraph -UseDeviceAuthentication
```

Annoying to have to use another device that has a GUI, but it's an option.
January 14, 2026 at 5:20 PM
Yesterday on Linkedin I shared another story about device codes being exploited by hackers, so this seems like a good time to link my blog post regarding #Devicecode on agderinthe.cloud

agderinthe.cloud/2025/01/31/i...
I’m so ACDC! – Alarmingly Concerned (about) Device Codes!
What’s a Device Code? When you want to log in and authenticate to Entra ID, you may not always have the same input capabilities as you have on your computer. This can be devices without keybo…
agderinthe.cloud
September 2, 2025 at 6:45 AM
DEBULL phishing campaign exploits Microsoft's device-code flow to hijack M365 accounts, bypassing MFA. #CyberSecurity #Phishing #Microsoft365 #DEBULL #MFA #DeviceCode thedailytechfeed.com/debull-explo...
July 7, 2026 at 3:36 PM
Zo veel waarschuwingen, als je als bedrijf nog steeds DeviceCode auth toestaat, dan vraag je er ook om en heeft iemand liggen slapen. #security

www.bleepingcomputer.com/news/securit...
Hackers target Microsoft Entra accounts in device code vishing attacks
Threat actors are targeting technology, manufacturing, and financial organizations in campaigns that combine device code phishing and voice phishing (vishing) to abuse the OAuth 2.0 Device Authorizati...
www.bleepingcomputer.com
February 24, 2026 at 7:04 PM
'Microsoft Defender Security Research has observed a widespread phishing campaign leveraging the Device Code Authentication flow to compromise organisational accounts at scale.'

#Microsoft #Phishing #DeviceCode
Inside an AI‑enabled device code phishing campaign | Microsoft Security Blog
A new wave of device code phishing shows how threat actors are scaling account compromise using AI and end‑to‑end automation. This campaign goes beyond traditional phishing by generating live authenti...
www.microsoft.com
April 8, 2026 at 9:42 AM
Attackers are bypassing MFA by abusing legit login workflows. Device Code phishing, BEC, and ATO can evade traditional defenses, while behavioral AI helps spot compromise earlier. #DeviceCode #BEC #AbnormalAI
Webinar: How attackers bypass MFA and how defenders can respond
Many organizations rely on multi-factor authentication as a key safeguard, but attackers are increasingly bypassing it by abusing legitimate authentication workflows instead of stealing passwords. The webinar “Stop chasing alerts: Automating email security with behavioral AI” will show how Device Code phishing, BEC, and ATO attacks can evade traditional defenses and how behavioral AI can help detect compromise earlier. #DeviceCodePhishing #AbnormalAI #BleepingComputer #NovantHealth
www.hendryadrian.com
June 19, 2026 at 1:45 PM
Microsoft faces a large-scale phishing campaign exploiting OAuth device code flow to bypass MFA, using AI-driven automation and cloud redirects via compromised domains targeting Italian Public Administration. #DeviceCode #PhishingAttack #Italy
Phishing on Microsoft via Device Code Flow: Automation and AI Amplify Its Spread — Impact on the Italian Public Administration
Microsoft warned of a large-scale phishing campaign that abuses the OAuth device code flow to obtain access tokens and bypass multi-factor authentication. Attackers use AI-driven automation, dynamic device-code generation via in-page JavaScript, and cloud-hosted redirects through compromised domains to scale and evade detection. #Microsoft #DeviceCodeFlow
www.hendryadrian.com
April 9, 2026 at 11:30 AM
State actors are abusing #OAuth #device #codes to get full #M365 account access

#Cybercriminals, including state-sponsored threat actors, are increasingly abusing #Microsoft’ s #OAuth2.0 #devicecode #authentication flow to take over #Microsoft365 accounts.

www.techradar.com/pro/security...
State actors are abusing OAuth device codes to get full M365 account access - here's what we know
Researchers spotted multiple groups using the same technique
www.techradar.com
December 19, 2025 at 3:18 PM
Have you blocked Device Code flow by default yet? If not, this very slow Graph PowerShell Beta command will tell you who is using them Get-MgBetaAuditLogSignIn -Filter "AuthenticationProtocol eq 'deviceCode'" Microsoft calls this a best practice, so go create the CA policy ;)
November 18, 2024 at 12:06 AM