NodeAuthOptions type

  • clientID - 應用程式的客戶端ID。
  • 權威 - 權威的網址。 若未設定值,則預設為 https://login.microsoftonline.com/common
  • knownAuthorities - Azure B2C 與 ADFS 需要。 所有將用於客戶應用程式的權限。 只有權威的主體應該被傳入。
  • clientSecret - 應用程式在請求標記時使用的秘密字串。 僅用於機密客戶應用。 可以在 Azure 應用程式註冊入口網站建立。
  • clientAssertion - 一個包含斷言字串或回調函式的 ClientAssertion 物件,該函式回傳應用程式在請求標記時使用的斷言字串,以及斷言的類型(urn:ietf:params:oAuth:client-assertion-type:jwt-bearer)。 僅用於機密客戶應用。
  • clientCertificate - 應用程式在請求令牌時使用的憑證。 僅用於機密客戶應用。 需要憑證的十六進位編碼 X.509 SHA-1 或 SHA-256 指紋,以及 PEM 編碼的私鑰(字串應包含 -----開始私鑰----- ... -----結束私鑰-----)
  • protocolMode - 代表 MSAL 所遵循的協定的 Enum。 用於設定適當的端點。
  • skipAuthorityMetadataCache - 一個標記,用於在權限初始化時選擇是否使用本地的元資料快取。 預設為 False。
  • encodeExtraQueryParams - 一個旗標,用來決定是否在請求 URL 中編碼額外查詢參數。 預設為 False。
type NodeAuthOptions = {
  authority?: string
  authorityMetadata?: string
  azureCloudOptions?: AzureCloudOptions
  clientAssertion?: string | ClientAssertionCallback
  clientCapabilities?: string[]
  clientCertificate?: {
    privateKey: string
    thumbprint?: string
    thumbprintSha256?: string
    x5c?: string
  }
  clientId: string
  clientSecret?: string
  cloudDiscoveryMetadata?: string
  encodeExtraQueryParams?: boolean
  knownAuthorities?: string[]
  protocolMode?: ProtocolMode
  skipAuthorityMetadataCache?: boolean
}