使用 MSAL 為使用者取得 Microsoft Entra ID (先前稱為 Azure Active Directory) 令牌

重要

本文說明如何使用 Microsoft 驗證連結庫 (MSAL) 手動建立 Microsoft Entra ID (先前稱為 Azure Active Directory) 令牌。

Databricks 不建議您手動為 Azure Databricks 使用者建立 Microsoft Entra ID (先前稱為 Azure Active Directory) 令牌。 這是因為每個 Microsoft Entra ID 令牌都是短期的,通常會在一小時內到期。 在這段時間之後,您必須手動產生取代的 Microsoft Entra ID 令牌。 請改用其中一個參與的工具或 SDK 來實 作 Databricks 用戶端統一驗證 標準。 這些工具和 SDK 會自動為您產生並取代過期的 Microsoft Entra ID 令牌,並利用 Azure CLI 驗證

Azure Databricks 受控服務主體會直接在 Azure Databricks 中管理。 Microsoft Entra ID 受控服務主體是在 Microsoft Entra ID 中管理,這需要額外的許可權。 Databricks 建議您針對大部分使用案例使用 Azure Databricks 受控服務主體。 不過,Databricks 建議您在必須同時向 Azure Databricks 和其他 Azure 資源進行驗證的情況下,使用 Microsoft Entra ID 受控服務主體。

若要建立 Azure Databricks 受控服務主體,而不是 Microsoft Entra ID 受控服務主體,請參閱 管理服務主體

您可以使用 Microsoft 驗證連結庫 (MSAL) 以程式設計方式取得 Microsoft Entra ID 存取權杖。 本文說明 MSAL 連結庫和必要使用者輸入的基本用法,以及 Python 範例。

注意

MSAL 會取代 Microsoft Entra ID Authentication Library (ADAL)。 ADAL 的所有 Microsoft 支援和開發,包括安全性修正,已於 2022 年 6 月 30 日結束。 請參閱將應用程式遷移至 Microsoft 驗證連結庫 (MSAL)。

提示

您可能會想要嘗試使用 Azure CLI,而不是 MSAL 來取得使用者的 Microsoft Entra ID 令牌,因為使用 Azure CLI 牽涉到較少的步驟。 請參閱 使用 Azure CLI 取得使用者的 Microsoft Entra ID (先前稱為 Azure Active Directory) 令牌。

您也可以在 Microsoft Entra ID 中定義服務主體,並取得服務主體的 Microsoft Entra ID 存取令牌,而不是針對使用者。 請參閱 取得服務主體的 Microsoft Entra 識別碼(先前稱為 Azure Active Directory) 令牌。

在 Azure 入口網站 中設定應用程式

在 Azure 入口網站 中向 Microsoft Entra ID 端點註冊應用程式。 或者,您可以使用已註冊的 Microsoft Entra ID 應用程式。 如需詳細資訊,請參閱使用 Azure 入口網站 註冊應用程式。

  1. 登入 Azure 入口網站

    注意

    要使用的入口網站會根據您的 Microsoft Entra ID 應用程式在 Azure 公用雲端或國家或主權雲端中執行而有所不同。 如需詳細資訊,請參閱 國家雲端

  2. 如果您有多個租使用者、訂用帳戶或目錄的存取權,請按兩下 頂端選單中的 [目錄 + 訂用帳戶] 圖示,以切換至您要註冊應用程式的目錄。

  3. 搜尋並選取 Microsoft Entra ID

  4. 在 [管理] 中,選取 [應用程式註冊 > [新增註冊]。

  5. 針對 [ 名稱],輸入應用程式的名稱。

  6. 在 [支持的帳戶類型] 區段中,選取 [僅限此組織目錄中的帳戶](單一租使用者)。

  7. 在 [ 重新導向 URI (選擇性) ] 區段中,針對 [選取平臺],選取 [公用用戶端/原生 ] (行動裝置和桌面版), 然後輸入重新導向 URI。 在下列範例中,重新導向 URI 值為 http://localhost

    Register app

  8. 按一下 [註冊] 。

  9. 在應用程式頁面的 [概觀 ] 頁面上的 [Essentials ] 區段中,複製下列值:

    • 應用程式 (用戶端) 識別碼
    • 目錄 (租使用者) 識別碼
    • 在 [重新導向 URI] 中,您稍早在此程式中輸入的公用用戶端重新導向 URI。

    Azure registered app overview

  10. 將 AzureDatabricks 新增至已註冊應用程式的必要許可權。 您必須是系統管理員使用者,才能執行此步驟。 如果您在執行此動作時遇到許可權相關問題,請連絡系統管理員以取得協助。

    1. 在應用程式頁面的 [概觀] 頁面上的 [開始使用] 索引卷標上,按兩下 [檢視 API 許可權]。

      Azure registered app settings

    2. 按兩下 [ 新增許可權]。

      Add required permissions to app

    3. 在 [ 要求 API 許可權 ] 窗格中,按兩下 [我的組織使用的 API] 索引標籤,搜尋 AzureDatabricks,然後加以選取。

      Add AzureDatabricks API permission

    4. 啟用 [user_impersonation] 複選框,然後按兩下 [新增許可權]。

      Azure app delegated permissions

    5. 按兩下 [ 授與 ### 的管理員同意],然後按兩下 [ ]。 若要執行此動作,您必須是系統管理員使用者,或具有授與應用程式同意的許可權。 如果您沒有看到授與 ### 的管理員同意,或略過此動作,您必須先使用授權碼流程 (interactive) 第一次使用應用程式來提供同意。 之後,您可以使用 Username-password 流程 (程序設計) 方法。

      Add additional users and groups to app permissions

您可以將其他使用者新增至應用程式。 如需詳細資訊,請參閱將用戶帳戶指派給企業應用程式,以取得 Azure 入口網站 指示或將使用者和群組指派給 Microsoft Entra ID(先前稱為 Azure Active Directory)中的應用程式,以取得 PowerShell 指示。 用戶將無法在沒有必要許可權的情況下取得令牌。

取得 Microsoft Entra ID 存取令牌

若要取得 Microsoft Entra ID 存取令牌,您可以使用下列其中一項:

您必須使用授權碼流程 (interactive) 來取得 Microsoft Entra ID 存取令牌,前提是:

  • Microsoft Entra ID 中已啟用雙因素驗證。
  • 同盟驗證會在 Microsoft Entra ID 中啟用。
  • 在應用程式註冊期間,您未獲得已註冊應用程式的同意。

如果您有使用使用者名稱和密碼登入的授權單位,您可以使用使用者名稱密碼流程(程序設計方式)來取得 Microsoft Entra ID 存取令牌。

授權碼流程 (互動式)

使用授權碼流程取得 Microsoft Entra ID 存取令牌有兩個步驟。

  1. 要求授權碼,以啟動瀏覽器視窗並要求 Azure 使用者登入。 使用者成功登入之後,就會傳回授權碼。
  2. 使用授權碼來取得 Microsoft Entra ID 存取令牌。 根據您使用的方法,您也可以同時傳回重新整理令牌,並可用來重新整理 Microsoft Entra ID 存取令牌。

完成這兩個步驟的其中一種方法是使用網頁瀏覽器和 curl。 若要這樣做,您可以使用網頁瀏覽器來取得授權碼,然後使用授權碼並 curl 取得 Microsoft Entra ID 存取令牌。 此方法不提供重新整理令牌。

另一種方法是使用 MSAL Python 連結庫。 若要這樣做,您可以執行使用網頁瀏覽器取得授權碼的單一腳本,然後使用授權碼來取得存取和重新整理令牌。

這兩種方法都假設您已登入 Azure。 如果您未登入,網頁瀏覽器會提示您這麼做。

使用網頁瀏覽器和 curl 取得 Microsoft Entra 識別碼令牌

  1. 收集以下資訊:

    參數 描述
    租用戶識別碼 Azure 入口網站 中設定應用程式中,於 Microsoft Entra ID 中註冊之相關應用程式的目錄(租使用者)標識符
    用戶端識別碼 Microsoft Entra ID 中註冊之相關應用程式的應用程式(用戶端) 標識碼。
    重新導向 URI 適用於 Microsoft Entra ID 中註冊之相關應用程式的適當 重新導向 URI (例如 , http://localhost。 驗證回應會傳送至此 URI,其中包含授權碼。
  2. 使用網頁瀏覽器瀏覽至下列 URL,以取得授權碼。 請據以取代下列 URL 範例中的欄位。 請注意,URL 必須以單行傳送;換行符已新增至下列 URL 以取得可讀性。 如需詳細資訊,請參閱 要求授權碼

    https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/authorize?client_id=<client-id>
    &response_type=code
    &redirect_uri=<redirect-uri>
    &response_mode=query
    &scope=2ff814a6-3304-4ab8-85cb-cd0e6f879c1d%2F.default
    &state=<state>
    

    將:

    • <tenant-id> 具有已註冊應用程式的租用戶標識碼。
    • <client-id> 具有已註冊應用程式的用戶端標識碼。
    • <redirect-uri> 使用已註冊應用程式的重新導向 URI。 此 URI 必須採用 URL 編碼(百分比編碼)格式。 例如, http://localhosthttp%3A%2F%2Flocalhost
    • <state> 具有隨機數或某些編碼資訊。 為了協助檢查資訊交換的完整性,此狀態值應該符合此程式稍後傳回URL中的值。

    請勿變更 參數的值 scope 。 它代表 Azure Databricks (2ff814a6-3304-4ab8-85cb-cd0e6f879c1d) 的程式設計標識碼,以及預設範圍 (/.defaultURL 編碼為 %2f.default)。

    例如:

    https://login.microsoftonline.com/a1bc2d34-5e67-8f89-01ab-c2345d6c78de/oauth2/v2.0/authorize?client_id=12a34b56-789c-0d12-e3fa-b456789c0123
    &response_type=code
    &redirect_uri=http%3A%2F%2Flocalhost
    &response_mode=query
    &scope=2ff814a6-3304-4ab8-85cb-cd0e6f879c1d%2F.default
    &state=12345
    
  3. 將 URL 貼上為網頁瀏覽器的單一行,如果出現提示,請登入 Azure。

    HTTP request URL

  4. 授權碼位於 code 傳回 URL 的 欄位中。 將授權碼儲存在安全的位置。 此外,請檢查以確定欄位的值符合您稍早在此程式中所提供的值 state

    Authorization code URL

    完整傳回的 URL 看起來會像這樣(將完整 code 域值縮短為 0.ASkAIj...RxgFhSAA 這裡以求簡潔):

    http://localhost/?code=0.ASkAIj...RxgFhSAA&state=12345&session_state=c44574d5-38ba-4f93-b2a3-a830db8e8cdf
    
  5. 使用授權碼以及 curl 取得 Microsoft Entra ID 存取令牌。

    curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' \
    https://login.microsoftonline.com/<tenant-id>/oauth2/v2.0/token \
    -d 'client_id=<client-id>' \
    -d 'scope=2ff814a6-3304-4ab8-85cb-cd0e6f879c1d%2F.default' \
    -d 'code=<authorization-code>' \
    -d 'redirect_uri=<redirect-uri>' \
    -d 'grant_type=authorization_code' \
    -d 'state=<state>'
    

    將:

    • <tenant-id> 具有已註冊應用程式的租用戶標識碼。
    • <client-id> 具有已註冊應用程式的用戶端標識碼。
    • <authorization-code> 使用您的授權碼。
    • <redirect-uri> 使用已註冊應用程式的重新導向 URI。 此 URI 必須採用 URL 編碼 (percent-endoded) 格式。 例如, http://localhosthttp%3A%2F%2Flocalhost
    • <state> 具有隨機數或某些編碼資訊。 為了協助檢查資訊交換的完整性,此狀態值應該符合此程式稍後響應承載中的值。

    請勿變更 參數的值 scope 。 它代表 Azure Databricks (2ff814a6-3304-4ab8-85cb-cd0e6f879c1d) 的程式設計標識碼,以及預設範圍 (/.defaultURL 編碼為 %2f.default)。

    例如:

    curl -X POST -H 'Content-Type: application/x-www-form-urlencoded' \
    https://login.microsoftonline.com/a1bc2d34-5e67-8f89-01ab-c2345d6c78de/oauth2/v2.0/token \
    -d 'client_id=12a34b56-789c-0d12-e3fa-b456789c0123' \
    -d 'scope=2ff814a6-3304-4ab8-85cb-cd0e6f879c1d%2F.default' \
    -d 'code=0.ASkAIj...RxgFhSAA' \
    -d 'redirect_uri=http%3A%2F%2Flocalhost' \
    -d 'grant_type=authorization_code' \
    -d 'state=12345'
    

    Microsoft Entra ID 令牌位於 access_token 呼叫結果中的值中。 請務必檢查值是否符合 state 您稍早在此程式中提供的值。

使用 MSAL Python 連結庫取得 Microsoft Entra ID 令牌

  1. 收集以下資訊:

    參數 描述
    租用戶識別碼 Azure 入口網站 中設定應用程式中,於 Microsoft Entra ID 中註冊之相關應用程式的目錄(租使用者)標識符
    用戶端識別碼 Microsoft Entra ID 中註冊之相關應用程式的應用程式(用戶端) 標識碼。

    此程式假設您已將 http://localhost 設定為 Microsoft Entra ID 中註冊之相關應用程式的重新導向 URI

  2. 執行 pip install msal,在您的本機計算機上安裝 MSAL Python SDK。

  3. 將下列程式代碼儲存為 get-tokens.py 本機計算機上。

    # Given the client ID and tenant ID for an app registered in Azure,
    # provide a <ms-entra-id> access token and a refresh token.
    
    # If the caller is not already signed in to Azure, the caller's
    # web browser will prompt the caller to sign in first.
    
    # pip install msal
    from msal import PublicClientApplication
    import sys
    
    # You can hard-code the registered app's client ID and tenant ID here,
    # or you can provide them as command-line arguments to this script.
    client_id = '<client-id>'
    tenant_id = '<tenant-id>'
    
    # Do not modify this variable. It represents the programmatic ID for
    # Azure Databricks along with the default scope of '/.default'.
    scopes = [ '2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default' ]
    
    # Check for too few or too many command-line arguments.
    if (len(sys.argv) > 1) and (len(sys.argv) != 3):
      print("Usage: get-tokens.py <client ID> <tenant ID>")
      exit(1)
    
    # If the registered app's client ID and tenant ID are provided as
    # command-line variables, set them here.
    if len(sys.argv) > 1:
      client_id = sys.argv[1]
      tenant_id = sys.argv[2]
    
    app = PublicClientApplication(
      client_id = client_id,
      authority = "https://login.microsoftonline.com/" + tenant_id
    )
    
    acquire_tokens_result = app.acquire_token_interactive(
      scopes = scopes
    )
    
    if 'error' in acquire_tokens_result:
      print("Error: " + acquire_tokens_result['error'])
      print("Description: " + acquire_tokens_result['error_description'])
    else:
      print("Access token:\n")
      print(acquire_tokens_result['access_token'])
      print("\nRefresh token:\n")
      print(acquire_tokens_result['refresh_token'])
    
  4. 執行下列其中一項動作:

    • 在上述程式代碼中,將 取代 <client-id> 為已註冊應用程式的用戶端識別碼和 <tenant-id> 已註冊應用程式的租使用者識別碼,然後執行腳本,例如 python get-tokens.py
    • 當您執行文稿時,請提供已註冊應用程式的用戶端識別碼和已註冊應用程式的租使用者識別碼,例如 python get-tokens.py 12a34b56-789c-0d12-e3fa-b456789c0123 a1bc2d34-5e67-8f89-01ab-c2345d6c78de
  5. 如果您的網頁瀏覽器提示您,請登入 Azure。

  6. Microsoft Entra ID 存取和重新整理令牌會列印在輸出中。

使用者名稱密碼流程 (程序設計)

  1. 如果您有使用使用者名稱和密碼登入的授權單位,請收集下列資訊:

    參數 描述
    租用戶識別碼 Azure 入口網站 中設定應用程式中,於 Microsoft Entra ID 中註冊之相關應用程式的目錄(租使用者)標識符
    用戶端識別碼 Microsoft Entra ID 中註冊之已實作應用程式的應用程式(用戶端) 標識碼。
    使用者名稱與密碼 用戶名稱(也就是登入 Azure 入口網站 時的電子郵件位址),以及租用戶中用戶的密碼。

    此程式假設您已將 http://localhost 設定為 Microsoft Entra ID 中註冊之相關應用程式的重新導向 URI

  2. 執行 pip install msal,在您的本機計算機上安裝 MSAL Python SDK。

  3. 將下列程式代碼儲存為 get-tokens-for-user.py 本機計算機上。

    # Given the client ID and tenant ID for an app registered in Azure,
    # along with an Azure username and password,
    # provide a <ms-entra-id> access token and a refresh token.
    
    # If the caller is not already signed in to Azure, the caller's
    # web browser will prompt the caller to sign in first.
    
    # pip install msal
    from msal import PublicClientApplication
    import sys
    
    # You can hard-code the registered app's client ID and tenant ID here,
    # along with the Azure username and password,
    # or you can provide them as command-line arguments to this script.
    client_id = '<client-id>'
    tenant_id = '<tenant-id>'
    username = '<username>'
    password = '<password>'
    
    # Do not modify this variable. It represents the programmatic ID for
    # Azure Databricks along with the default scope of '/.default'.
    scope = [ '2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default' ]
    
    # Check for too few or too many command-line arguments.
    if (len(sys.argv) > 1) and (len(sys.argv) != 5):
      print("Usage: get-tokens-for-user.py <client ID> <tenant ID> <username> <password>")
      exit(1)
    
    # If the registered app's client ID and tenant ID along with the
    # Azure username and password are provided as command-line variables,
    # set them here.
    if len(sys.argv) > 1:
      client_id = sys.argv[1]
      tenant_id = sys.argv[2]
      username = sys.argv[3]
      password = sys.argv[4]
    
    app = PublicClientApplication(
      client_id = client_id,
      authority = "https://login.microsoftonline.com/" + tenant_id
    )
    
    acquire_tokens_result = app.acquire_token_by_username_password(
      username = username,
      password = password,
      scopes = scope
    )
    
    if 'error' in acquire_tokens_result:
      print("Error: " + acquire_tokens_result['error'])
      print("Description: " + acquire_tokens_result['error_description'])
    else:
      print("Access token:\n")
      print(acquire_tokens_result['access_token'])
      print("\nRefresh token:\n")
      print(acquire_tokens_result['refresh_token'])
    
  4. 執行下列其中一項動作:

    • 在上述程式代碼中,將 取代 <client-id> 為已註冊應用程式的用戶端識別碼、 <tenant-id> 以已註冊應用程式的租使用者識別碼、 <username> 使用者名稱和 <password> 密碼取代 ,然後執行腳本,例如 python get-tokens-for-user.py
    • 提供已註冊應用程式的用戶端識別碼、已註冊應用程式的租使用者識別碼、使用者名稱,以及執行文稿時的密碼,例如 python get-tokens-for-user.py 12a34b56-789c-0d12-e3fa-b456789c0123 a1bc2d34-5e67-8f89-01ab-c2345d6c78de someone@example.com "MyPa55w&rd!"。 如果命令行自變數包含特殊字元,您應該用引號括住它。
  5. Microsoft Entra ID 存取和重新整理令牌會列印到您的終端機。

使用 Microsoft Entra ID 存取令牌來存取 Databricks REST API

本節說明如何使用 Microsoft Entra ID 存取令牌來呼叫 Databricks REST API。 在下列範例中,將 取代為 Microsoft Entra ID 存取令牌,並以 <databricks-instance> Azure Databricks 部署的個別工作區 URL 取代 <access-token>

Python 範例

此範例示範如何在 Azure Databricks 工作區中列出叢集。

import requests
import json

databricks_instance = '<databricks-instance>'
api_version = '/api/2.0'
api_command = '/clusters/list'
url = f"https://{databricks_instance}{api_version}{api_command}"
access_token = '<access-token>'

response = requests.get(
  url = url,
  headers = { 'Authorization': "Bearer " + access_token}
)

print(json.dumps(json.loads(response.text), indent = 2))

注意

如果您是非系統管理員使用者,而且想要以系統管理員使用者身分登入,除了標頭之外,還必須提供X-Databricks-Azure-Workspace-Resource-Id標頭'Authorization' : 'Bearer ',而且您必須在 Azure 中工作區資源的參與者或擁有者角色中。 您可以建構 X-Databricks-Azure-Workspace-Resource-Id 值,如下所示:

# ...

subscription = '<azure-subscription-id>'
resource_group = '<azure-resource-group-name>'
workspace = '<databricks-workspace-name-in-azure>'

db_resource_id = '/subscriptions/%s/resourcegroups/%s/providers/microsoft.databricks/workspaces/%s' % (
  subscription,
  resource_group,
  workspace
)

# ...

  headers = {
    'Authorization': "Bearer " + access_token,
    'X-Databricks-Azure-Workspace-Resource-Id': db_resource_id
  }

# ...

若要取得 Azure 中的訂用帳戶、資源和工作區資訊,請參閱 開啟資源。 若要開啟目標資源,您可以搜尋 Azure Databricks 服務類型,以及您在 Azure 中了解目標 Azure Databricks 工作區的任何其他資訊。

curl 例子

curl -X GET \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <access-token>' \
https://<databricks-instance>/api/2.0/clusters/list

重新整理 Microsoft Entra ID 存取令牌

如果您取得重新整理令牌以及 Microsoft Entra ID 存取權杖,您可以使用重新整理權杖來取得新的權杖。 根據預設,Microsoft Entra ID 存取令牌的存留期是 60 到 90 分鐘之間的隨機時間週期(平均 75 分鐘)。 您可以使用 Microsoft Entra ID (先前稱為 Azure Active Directory) 中可設定權杖存留期的方法 ,設定 Microsoft Entra ID 存取令牌的存留期。

下列範例示範如何使用 MSAL Python 連結庫以及重新整理令牌來取得新的令牌。

  1. 將下列程式代碼儲存為 refresh-tokens.py 本機計算機上。

    # Given the client ID and tenant ID for an app registered in Azure,
    # along with a refresh token, provide a new <ms-entra-id> access token and
    # refresh token.
    
    # If the caller is not already signed in to Azure, the caller's
    # web browser will prompt the caller to sign in first.
    
    # pip install msal
    from msal import PublicClientApplication
    import sys
    
    # You can hard-code the registered app's client ID, tenant ID,
    # and refresh token here, or you can provide them as command-line
    # arguments to this script.
    client_id = '<client-id>'
    tenant_id = '<refresh-token'
    refresh_token = '<refresh-token>'
    
    # Do not modify this variable. It represents the programmatic ID for
    # Azure Databricks along with the default scope of '.default'.
    scope = [ '2ff814a6-3304-4ab8-85cb-cd0e6f879c1d/.default' ]
    
    # Check for too few or too many command-line arguments.
    if (len(sys.argv) > 1) and (len(sys.argv) != 4):
      print("Usage: refresh-tokens.py <client ID> <tenant ID> <refresh token>")
      exit(1)
    
    # If the registered app's client ID, tenant ID, and refresh token are
    # provided as command-line variables, set them here.
    if len(sys.argv) > 1:
      client_id = sys.argv[1]
      tenant_id = sys.argv[2]
      refresh_token = sys.argv[3]
    
    app = PublicClientApplication(
      client_id = client_id,
      authority = "https://login.microsoftonline.com/" + tenant_id
    )
    
    acquire_tokens_result = app.acquire_token_by_refresh_token(
      refresh_token = refresh_token,
      scopes = scope
    )
    
    if 'error' in acquire_tokens_result:
      print("Error: " + acquire_tokens_result['error'])
      print("Description: " + acquire_tokens_result['error_description'])
    else:
      print("\nNew access token:\n")
      print(acquire_tokens_result['access_token'])
      print("\nNew refresh token:\n")
      print(acquire_tokens_result['refresh_token'])
    
  2. 執行下列其中一項動作:

    • 在上述程式代碼中,將 取代 <client-id> 為已註冊應用程式的用戶端識別碼、 <tenant-id> 註冊應用程式的租使用者識別碼,以及 <refresh-token> 重新整理令牌,然後執行腳本,例如 python get-tokens-for-user.py
    • 提供已註冊應用程式的用戶端識別碼、已註冊的應用程式租使用者識別碼,以及執行腳本時的重新整理令牌,例如 python refresh-tokens.py 12a34b56-789c-0d12-e3fa-b456789c0123 a1bc2d34-5e67-8f89-01ab-c2345d6c78de "0.ASkAIj...huE84ALg"。 如果命令行自變數包含特殊字元,您應該以引號括住它。
  3. 新的 Microsoft Entra 識別碼存取和重新整理令牌會列印到您的終端機。