The Primary Refresh Token is the credential that makes Windows, macOS and mobile single sign-on to Microsoft Entra ID work, and whoever can use it from outside its device inherits the user's sessions, MFA claim and device compliance. A PRT is valid for 90 days and renewed while the device is used, so it is a long-lived, high-value target for token theft (MITRE ATT&CK T1528 Steal Application Access Token, reused as T1550.001 Application Access Token). This guide explains how the PRT is issued, bound and renewed, which admin roles and device settings decide its safety, what to log, and a hardening baseline built on TPM binding, Token Protection and device hygiene. It is for Entra, endpoint and detection engineers. It is defensive only: no token extraction methods are described. For the wider tenant, see the Entra ID Security Guide.
This is an independent guide from NHI Mgmt Group, based on Microsoft's public documentation as of November 2026. It is not sponsored or reviewed by Microsoft. Product features change, so confirm settings against Microsoft's current documentation.
Key takeaways
- The PRT is a device credential as much as a user one. It is bound to keys created at device registration, and its safety depends on those keys being in a TPM, not in software.
- It carries the MFA claim. A Windows Hello for Business sign-in gives the PRT an MFA claim that is refreshed at each renewal, so Conditional Access sees MFA without a new prompt.
- Token Protection makes theft less useful. The Conditional Access session control accepts only device-bound sign-in session tokens for supported apps, so a token replayed from another device is refused.
- Disabling the device is the fastest kill switch. Disabling a device in Entra ID revokes its PRT and refresh tokens and blocks Windows Hello for Business; revoking user sessions alone leaves current access tokens valid for up to an hour.
- Device administrators are PRT administrators. Local admin on a device, Cloud Device Administrator and Intune Administrator decide who can reach or revoke PRTs; scope them like privileged roles.
How identity and access work for the PRT
Microsoft describes the PRT as an opaque artifact issued to Microsoft first-party token brokers to enable SSO on supported Windows, iOS, macOS, Android and Linux devices. Client components cannot read its contents.
Issuance and binding
- Keys at registration: when a device registers, it generates a device key and a transport key. With a working TPM the private halves are bound to the TPM. Microsoft recommends TPM 2.0 for all registration scenarios on Windows 10 and later, and Entra ID does not use TPM 1.2 for these keys after Windows 10 version 1903.
- Session key: when the PRT is issued, Entra ID returns a session key encrypted to the transport key. That key is the proof-of-possession key for later requests; Entra ID rejects requests not signed by it. A PRT is not issued if the device key signature cannot be validated.
- Who issues it: on Entra joined and hybrid joined Windows the CloudAP plugin obtains the PRT during Windows sign-in; on Entra registered devices (a work account added to a personal device) the Web Account Manager (WAM) plugin is the authority.
- Registered and unregistered PRTs: clients prefer a registered device PRT; only that type satisfies device registration policies. Unregistered device PRTs are bound to a client-generated key pair.
Lifetime and renewal
| Property | Value (Microsoft Learn) | Security meaning |
|---|---|---|
| Validity | 90 days, continuously renewed while the device is used | Long-lived; theft gives durable access unless bound or revoked |
| Renewal by CloudAP | Every 4 hours during Windows sign-in | Revocation takes effect at renewal; offline devices renew after reconnecting |
| Conditional Access at issuance and renewal | Not evaluated | Policies apply when the PRT is used to get app tokens, not when it is minted |
| MFA claim with Windows Hello for Business | Refreshed on each renewal | MFA persists as long as the PRT does |
| Partitioning | Separate PRT per credential (Windows Hello, password, smart card) | MFA claims do not leak from one credential to another |
| Browser SSO | Edge natively, Chrome with the Microsoft Single Sign On extension, Firefox 91 and later with a Windows SSO setting; not in private browsing | The browser presents a PRT-derived credential in the x-ms-RefreshTokenCredential header |
What invalidates a PRT
- The user is disabled or deleted (cached sign-in can still work until CloudAP learns of it).
- The device is disabled or deleted in Entra ID.
- A password change, for a password-based PRT.
- A TPM failure, which makes the keys unusable and triggers re-registration.
Microsoft states that TPM-protected keys protect against actors trying to steal keys or replay the PRT. The corollary is the main risk: where keys are not hardware-bound, or where an adversary has administrative control of the signed-in device, the PRT and its session key are much easier to misuse. Defenders often call that replay "pass-the-PRT".
Admin roles and privileged access
| Role or right | What it can do to PRTs and devices | Control |
|---|---|---|
| Local administrator on a device | Full control of the signed-in user's session on that device | Remove the registering user from local admin; use Windows LAPS; scope Microsoft Entra Joined Device Local Administrator |
| Microsoft Entra Joined Device Local Administrator | Local admin on every Entra joined device, tenant-wide | Assign to few, eligible through PIM |
| Cloud Device Administrator | Change device settings; enable, disable and delete devices; read BitLocker keys | Privileged role: PIM, phishing-resistant MFA, admin workstation |
| Intune Administrator | Disable and delete devices, manage enrolled devices, run scripts and wipes | RBAC scope tags, multi-admin approval for destructive actions |
| Windows 365 Administrator | Delete devices | Assign only where Windows 365 is used |
| Users (default) | Join devices (default All), register devices, up to 50 devices each | Restrict join to a group; require MFA via the Register or join devices user action |
Device management roles are routinely treated as operational rather than privileged. Treat them as privileged: the same rights can wipe, disable or re-register devices at scale. See the Microsoft Intune Guide and the LAPS Guide.
Integrations, API tokens and service accounts
- The device object is a non-human identity: each joined or registered device has its own Entra identity and keys. Stale devices that stay enabled keep a valid identity in the directory. Run a lifecycle process for devices like any other machine identity. See the Machine Identity, PKI and Certificate Lifecycle Guide.
- Rogue device registration (T1098.005): an adversary with a user's credentials can register a device they control, obtain a registered device PRT and then satisfy device-based policies from it. Restricting who can join and register, requiring MFA for the Register or join devices user action, and requiring compliance (not just registration) close most of this.
- App refresh tokens on the device: Microsoft notes that app refresh tokens are encrypted with DPAPI and, for SSO users, bound to the device through the session or device key; for non-SSO users they are not device-bound. Apps that keep their own tokens outside the broker do not get PRT protection.
- Shared and kiosk devices: a shared device holds PRTs for every signed-in user; configure shared-device modes and sign-out so tokens do not accumulate.
- Automation and service accounts: PRTs belong to users on devices. Automation should use workload identities (managed identities, service principals with certificates or federated credentials), not a user account signed into a server, which would give that server a long-lived PRT. See the Workload Identity Federation Guide.
Logging and detection
| Signal | Source | Notes |
|---|---|---|
Possible attempt to access Primary Refresh Token (PRT), riskEventType attemptedPrtAccess | Entra ID Protection, sourced from Microsoft Defender for Endpoint | Offline detection, raises the user to high risk; Microsoft recommends prompt remediation; only fires where Defender for Endpoint is deployed |
Anomalous token, anomalousToken | Entra ID Protection | Unusual token lifetime or replay from an unfamiliar location; covers session and refresh tokens; noisier at low and medium risk |
Attacker in the Middle, attackerinTheMiddle | Entra ID Protection with Defender for Cloud Apps | Session linked to a malicious reverse proxy |
| Token Protection report-only results | Sign-in logs, interactive and non-interactive | Shows which sign-ins would fail because tokens were not device-bound |
| Same user, device ID claimed from a new IP, ASN or country within hours | Non-interactive sign-in logs | Classic replay pattern; correlate with endpoint telemetry for the device |
| Device registered or joined, device enabled after disable, device owner changed | Entra audit log (Device category) | Rogue registration and tampering |
| New assignments of Cloud Device Administrator, Intune Administrator or Joined Device Local Administrator | Entra audit log, PIM | Privilege over devices and PRTs |
Send both interactive and non-interactive sign-in logs to the SIEM: most PRT use is non-interactive. Microsoft's own Token Protection rollout advice is to capture both log types and analyse them across a full cycle of normal application use. See the Entra ID Sign-In and Audit Log Detection Guide.
Hardening baseline
- TPM 2.0 everywhere: require it in procurement and device compliance, and find devices registered with software keys. Re-register them once hardware is fixed.
- Windows Hello for Business or another phishing-resistant method: it gives a hardware-backed credential and a PRT with an MFA claim, removing password-based PRTs from daily use. See the Windows Hello for Business Guide.
- Token Protection in Conditional Access: pilot in report-only for Exchange Online, SharePoint Online and Teams native apps (generally available on Windows, macOS and iOS), plus Azure Virtual Desktop and Windows 365 on Windows. Windows support covers Windows 10 and later joined, hybrid joined or registered devices and hybrid joined Windows Server 2019 and later. Browser support for Azure Resource Manager web apps is in preview.
- Require compliant devices, not just registered ones, for sensitive apps and all admin portals, so a newly registered rogue device does not pass.
- Restrict device join and registration: set Users may join devices to a group, use the Register or join devices user action with MFA (and set the legacy per-tenant MFA setting to No when you do), and lower the maximum number of devices per user from 50.
- Remove standing local admin: stop adding the registering user as local administrator, use Entra or Windows LAPS for the built-in account, and keep the Joined Device Local Administrator role minimal.
- Sign-in frequency for high-risk access: the session control forces re-authentication regardless of PRT lifetime; apply it to admin portals and privileged roles.
- Endpoint protection that sees token access: the PRT access risk detection depends on Defender for Endpoint or an equivalent EDR signal; without it you have no host-side view.
- Device lifecycle: disable stale devices after a defined period of inactivity and delete later, wiping or retiring managed devices first.
Rollout and rollback for Token Protection
- Inventory platforms and app versions; unsupported clients will fail when enforced.
- Create the policy in report-only for a pilot group, targeting the supported resources only.
- Review interactive and non-interactive sign-ins for would-fail results; fix or exclude client types.
- Enforce for the pilot, then IT and admins, then wider groups.
- Roll back by switching the policy to report-only; keep a documented exclusion group with an owner and review date.
Responding to suspected PRT theft
- Disable the device in Entra ID (Cloud Device Administrator or Intune Administrator): this revokes its PRT and refresh tokens and blocks Windows Hello for Business on it.
- Revoke the user's sessions with Revoke sessions in the portal or
Revoke-MgUserSignInSession, and reset the password if a password-based PRT may be involved. Existing access tokens can stay valid for up to an hour, except in CAE-capable apps. - Isolate and investigate the endpoint: PRT misuse usually means the device was compromised; rebuild rather than clean.
- Review what the token reached: mailbox rules, OAuth consents, new MFA methods, new device registrations. See the OAuth Token Theft Incident Playbook.
Common misconfigurations
- Device-based policies that accept registration as trust: "require registered device" is satisfied by any device a user can register; use compliance or hybrid join requirements.
- Everyone may join devices, and every joiner is local admin: the default combination gives any user admin rights over a device that holds their PRT and can be registered at will.
- Software-key registrations left in place: devices registered before TPM fixes or on virtual machines without vTPM keep weaker binding indefinitely.
- Revoking sessions but not the device: on a compromised endpoint the device is the problem; user revocation alone lets the device obtain new tokens once the user signs in again.
- No non-interactive log ingestion: replayed tokens appear mainly as non-interactive sign-ins, which are often not exported because of volume.
- Device roles outside PIM: Cloud Device Administrator and Intune Administrator held permanently by large operations teams.
Framework mapping
| Framework | Reference |
|---|---|
| MITRE ATT&CK v20 | T1528 Steal Application Access Token; T1550.001 Application Access Token; T1539 Steal Web Session Cookie; T1098.005 Device Registration |
| NIST SP 800-53 Rev. 5 | IA-3 Device Identification and Authentication; SC-23 Session Authenticity; AC-12 Session Termination; AC-6 Least Privilege; SI-4 System Monitoring |
| NIST CSF 2.0 | PR.AA-01; PR.AA-04 identity assertions protected; PR.AA-05; DE.CM-01 |
| CIS Controls v8.1 | Control 1 Inventory of Enterprise Assets; Control 5 Account Management; Control 6 Access Control Management |
Practitioner checklist
- Report devices without TPM 2.0-backed registration and plan their re-registration or replacement.
- Deploy Windows Hello for Business or another phishing-resistant method so password-based PRTs fall out of daily use.
- Run Token Protection in report-only, then enforce for supported apps, admins first.
- Require compliant devices for admin portals and sensitive apps.
- Restrict device join to a group, require MFA for Register or join devices, and lower the per-user device limit.
- Stop making the registering user a local admin and manage local admin passwords with LAPS.
- Put Cloud Device Administrator, Intune Administrator and Joined Device Local Administrator behind PIM.
- Ingest non-interactive sign-ins and alert on attemptedPrtAccess and anomalousToken detections.
- Document the PRT theft response: disable device, revoke sessions, isolate endpoint, review reach.
Standards and references
- Microsoft Learn: Understanding Primary Refresh Token (PRT)
- Microsoft Learn: Token protection in Microsoft Entra Conditional Access
- Microsoft Learn: What are risk detections (Microsoft Entra ID Protection)
- Microsoft Learn: Manage device identities in Microsoft Entra ID
- Microsoft Learn: Revoke user access in Microsoft Entra ID
- MITRE ATT&CK: Steal Application Access Token (T1528)
- MITRE ATT&CK: Account Manipulation: Device Registration (T1098.005)
Related NHI Mgmt Group resources: Entra ID Security Guide · Conditional Access Guide · Session Hijacking and Cookie Theft Guide · AiTM Phishing Guide · Entra ID Cross-Tenant Access and B2B Guest Governance Guide