Generate a Temporary Access Pass (TAP) for a User via Microsoft Graph

Prev Next

Issue a time-limited passcode to bootstrap MFA, recover locked accounts, or onboard passwordless users in Entra ID.

Complexity: Intermediate. Impact: identity + authentication + mfa + onboarding + account-recovery.

Why use this workflow

A Temporary Access Pass (TAP) is a time-limited passcode issued by Entra ID that lets a user sign in and register or recover strong authentication methods (FIDO2 keys, Microsoft Authenticator, Windows Hello for Business). It is a recommended way to:

  • Bootstrap MFA for new hires on their first day
  • Recover access when a user loses their phone or security key
  • Onboard users into passwordless authentication without an initial password
  • Re-enable access after a lost-device scenario without a full password reset

TAP is governed by the Temporary Access Pass authentication method policy in Entra ID. Before you can issue a TAP, the policy must be enabled and the target user must fall within its scope. Admins can issue a TAP from the Entra admin center, Microsoft Graph, or PowerShell. This workflow covers all three.

Expected outcomes

  • You verified that the TAP authentication method policy is enabled for the target user
  • You generated a one-time or multi-use TAP with a defined lifetime
  • You delivered the pass to the user securely (it is visible only at creation time)
  • The action is recorded in the Entra ID sign-in and audit logs

Risks and considerations

Security considerations

  • A TAP is a bearer credential. Anyone who obtains the pass during its lifetime can sign in as the user. Deliver it through a trusted out-of-band channel (a verified phone call or an in-person handoff). Never email or chat it to an unverified address.
  • Prefer one-time, short-lived passes. Use isUsableOnce: true and the shortest lifetime that fits the workflow.
  • The policy must allow the target user. If the TAP authentication method policy is disabled or excludes the user's group, the API call returns an error such as 403 Forbidden or 400 Bad Request.
  • Privileged roles. Issuing a TAP for a Global Administrator or another privileged role requires the caller to hold an equal or higher role, such as Privileged Authentication Administrator.
  • Existing TAP. A user can have only one active TAP. Creating a new one while an existing TAP is valid fails. Delete the existing method first.
  • Audit. Review the Entra audit logs periodically for TAP creation, use, and deletion to detect abuse.

Required permissions

PermissionWhy it's needed
UserAuthenticationMethod.ReadWrite.AllRequired to create, read, and delete the temporaryAccessPassMethods object on any user
Policy.Read.AllNeeded to verify the TAP authentication method policy configuration before you create a TAP
Authentication Administrator (directory role)Minimum role to issue TAPs for non-admin users when you call Graph with delegated permissions
Privileged Authentication Administrator (directory role)Required to issue TAPs for users who hold administrative roles

Ask Dex

Paste the prompt into a Dex conversation.

Prompt for IT admins

Generate a 60-minute, one-time Temporary Access Pass for {user_upn} so they can bootstrap MFA. Check for and replace any existing TAP, then return the pass.

How an end user can ask Dex

I'm a new hire and I need a temporary code to set up the Authenticator app for the first time.

Manual steps (admin center)

  1. Sign in to the Microsoft Entra admin center as an Authentication Administrator or higher.
  2. Go to Identity > Users > All users.
  3. Search for and select the target user (for example, {user_upn}).
  4. On the user's page, select Authentication methods from the left navigation.
  5. Select Add authentication method at the top of the page.
  6. From the Choose method list, select Temporary Access Pass.
  7. Configure the pass:
    • Activation: Now or a scheduled start time
    • Duration: the lifetime of the pass, within the limits of your TAP policy
    • One-time use: turn on for single sign-in scenarios (recommended for onboarding)
  8. Select Add.
  9. The generated pass is displayed once. Copy it immediately and deliver it to the user through a trusted channel.

User self-service alternative

If your policy allows it, the user can add a method themselves at My Sign-Ins security info: Add sign-in method > Temporary Access Pass.

Microsoft Graph API

Endpoint

POST https://graph.microsoft.com/v1.0/users/{user-id-or-upn}/authentication/temporaryAccessPassMethods

Request body

{
  "isUsableOnce": true,
  "lifetimeInMinutes": 60,
  "startDateTime": "2025-01-15T09:00:00Z"
}

startDateTime is optional. Omit it to activate the pass immediately. lifetimeInMinutes must fall within the limits configured in your TAP policy (the Graph range is 10 to 43200 minutes).

Example response (201 Created)

{
  "id": "7c4f3eab-5d2c-4c6e-9e2f-1a2b3c4d5e6f",
  "temporaryAccessPass": "<temporary-access-pass>",
  "createdDateTime": "2025-01-15T09:00:00Z",
  "startDateTime": "2025-01-15T09:00:00Z",
  "lifetimeInMinutes": 60,
  "isUsableOnce": true,
  "isUsable": true,
  "methodUsabilityReason": "EnabledByPolicy"
}

The temporaryAccessPass field is returned only on creation. Later GET calls do not include it.

List existing TAPs

GET /v1.0/users/{user-id}/authentication/temporaryAccessPassMethods

Delete an existing TAP

DELETE /v1.0/users/{user-id}/authentication/temporaryAccessPassMethods/{tap-id}

Common errors

StatusMeaning
400The user already has an active TAP, or lifetimeInMinutes is out of range
401The caller token is missing UserAuthenticationMethod.ReadWrite.All or the required directory role
403The TAP policy does not permit this user (scope or disabled)

PowerShell

The Microsoft.Graph.Identity.SignIns module exposes New-MgUserAuthenticationTemporaryAccessPassMethod, which wraps the Graph endpoint above.

Prerequisites

# Install the Graph SDK (once per machine)
Install-Module Microsoft.Graph -Scope CurrentUser

# Connect with the right scopes
Connect-MgGraph -Scopes "UserAuthenticationMethod.ReadWrite.All"

Create a one-time, 60-minute TAP

$body = @{
    isUsableOnce     = $true
    lifetimeInMinutes = 60
}

$tap = New-MgUserAuthenticationTemporaryAccessPassMethod `
    -UserId "MeganB@contoso.com" `
    -BodyParameter $body

# The pass is only visible right now - copy it before the variable is discarded
$tap.TemporaryAccessPass

Check for and remove an existing TAP

$existing = Get-MgUserAuthenticationTemporaryAccessPassMethod -UserId "MeganB@contoso.com"
if ($existing) {
    Remove-MgUserAuthenticationTemporaryAccessPassMethod `
        -UserId "MeganB@contoso.com" `
        -TemporaryAccessPassAuthenticationMethodId $existing.Id
}