@azure/identity-broker 1.0.0-beta.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # Azure Identity plugin for brokered authentication
2
2
 
3
- This package provides a plugin to the Azure Identity library for JavaScript ([`@azure/identity`](https://npmjs.com/package/@azure/identity)) that enables using an authentication broker such as [WAM](https://learn.microsoft.com/azure/active-directory/develop/scenario-desktop-acquire-token-wam).
3
+ This package provides a plugin to the Azure Identity library for JavaScript ([`@azure/identity`](https://npmjs.com/package/@azure/identity)) that enables using an authentication broker such as [WAM](https://learn.microsoft.com/entra/identity-platform/scenario-desktop-acquire-token-wam).
4
4
 
5
- [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity-broker) | [Samples](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity-broker/samples)
5
+ An authentication broker is an application that runs on a user’s machine that manages the authentication handshakes and token maintenance for connected accounts. Currently, only the Windows authentication broker, Web Account Manager (WAM), is supported.
6
+
7
+ [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity-broker) | [Samples](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity-broker/samples) | [API reference documentation](https://azuresdkdocs.blob.core.windows.net/$web/javascript/azure-identity-broker/1.0.0-beta.1/index.html) | [Microsoft Entra ID documentation] (https://learn.microsoft.com/entra/identity/)
6
8
 
7
9
  ## Getting started
8
10
 
@@ -34,6 +36,22 @@ Azure Identity plugins for JavaScript support stable (even numbered) versions of
34
36
 
35
37
  If this is your first time using `@azure/identity` or Microsoft Entra ID, we recommend that you read [Using `@azure/identity` with Microsoft Entra ID](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/using-azure-identity.md) first. This document will give you a deeper understanding of the platform and how to configure your Azure account correctly.
36
38
 
39
+ ### Parent window handles
40
+
41
+ When authenticating with the broker via `InteractiveBrowserCredential`, a parent window handle is required to ensure that the authentication dialog is shown correctly over the requesting window. In the context of graphical user interfaces on devices, a window handle is a unique identifier that the operating system assigns to each window. For the Windows operating system, this handle is an integer value that serves as a reference to a specific window.
42
+
43
+ ## Microsoft account (MSA) passthrough
44
+
45
+ Microsoft accounts (MSA) are personal accounts created by users to access Microsoft services. MSA passthrough is a legacy configuration which enables users to get tokens to resources which normally don't accept MSA logins. This feature is only available to first-party applications. Users authenticating with an application that is configured to use MSA passthrough can set `legacyEnableMsaPassthrough` to `true` inside `InteractiveBrowserCredentialNodeOptions.brokerOptions` to allow these personal accounts to be listed by WAM.
46
+
47
+ ## Redirect URIs
48
+
49
+ Microsoft Entra applications rely on redirect URIs to determine where to send the authentication response after a user has logged in. To enable brokered authentication through WAM, a redirect URI matching the following pattern should be registered to the application:
50
+
51
+ ```
52
+ ms-appx-web://Microsoft.AAD.BrokerPlugin/{client_id}
53
+ ```
54
+
37
55
  ### Azure Identity plugins
38
56
 
39
57
  As of `@azure/identity` version 2.0.0, the Identity client library for JavaScript includes a plugin API. This package (`@azure/identity-broker`) exports a plugin object that you must pass as an argument to the top-level `useIdentityPlugin` function from the `@azure/identity` package. Enable native broker in your program as follows:
@@ -67,6 +85,7 @@ async function main() {
67
85
  const credential = new InteractiveBrowserCredential({
68
86
  brokerOptions: {
69
87
  enabled: true,
88
+ parentWindowHandle: <insert_current_window_handle>
70
89
  },
71
90
  });
72
91
 
@@ -82,9 +101,12 @@ main().catch((error) => {
82
101
  process.exit(1);
83
102
  });
84
103
  ```
104
+ For an example of using an Electron app for retrieving a window handle, see [this sample](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity-broker/samples/v1/typescript/src/index.ts).
85
105
 
86
106
  ## Troubleshooting
87
107
 
108
+ See the Azure Identity [troubleshooting guide][https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/TROUBLESHOOTING.md] for details on how to diagnose various failure scenarios.
109
+
88
110
  ### Logging
89
111
 
90
112
  Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the `AZURE_LOG_LEVEL` environment variable to `info`. Alternatively, logging can be enabled at runtime by calling `setLogLevel` in the `@azure/logger`:
package/dist/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var msalNodeExtensions = require('@azure/msal-node-extensions');
4
6
 
5
7
  // Copyright (c) Microsoft Corporation.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AzurePluginContext } from \"../../identity/src/plugins/provider\";\nimport { IdentityPlugin } from \"@azure/identity\";\nimport { NativeBrokerPlugin } from \"@azure/msal-node-extensions\";\n\n/**\n * A plugin that provides WAM Integration for `@azure/identity`\n * credentials. The plugin API is compatible with `@azure/identity` versions\n * 4.0.0 and later. Load this plugin using the `useIdentityPlugin`\n * function, imported from `@azure/identity`.\n *\n * Example:\n *\n * ```typescript\n * import { useIdentityPlugin, DeviceCodeCredential } from \"@azure/identity\";\n * import { nativeBrokerPlugin } from \"@azure/identity-broker\";\n *\n * // Load the plugin\n * useIdentityPlugin(nativeBrokerPlugin);\n * ```\n */\n\nexport const nativeBrokerPlugin: IdentityPlugin = (context: unknown) => {\n const { nativeBrokerPluginControl } = context as AzurePluginContext;\n const brokerPlugin = new NativeBrokerPlugin();\n nativeBrokerPluginControl.setNativeBroker(brokerPlugin);\n};\n"],"names":["NativeBrokerPlugin"],"mappings":";;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;AAeG;AAEU,MAAA,kBAAkB,GAAmB,CAAC,OAAgB,KAAI;AACrE,IAAA,MAAM,EAAE,yBAAyB,EAAE,GAAG,OAA6B,CAAC;AACpE,IAAA,MAAM,YAAY,GAAG,IAAIA,qCAAkB,EAAE,CAAC;AAC9C,IAAA,yBAAyB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;AAC1D;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AzurePluginContext } from \"../../identity/src/plugins/provider\";\nimport { IdentityPlugin } from \"@azure/identity\";\nimport { NativeBrokerPlugin } from \"@azure/msal-node-extensions\";\n\n/**\n * A plugin that provides WAM Integration for `@azure/identity`\n * credentials. The plugin API is compatible with `@azure/identity` versions\n * 4.0.0 and later. Load this plugin using the `useIdentityPlugin`\n * function, imported from `@azure/identity`.\n *\n * Example:\n *\n * ```typescript\n * import { useIdentityPlugin, DeviceCodeCredential } from \"@azure/identity\";\n * import { nativeBrokerPlugin } from \"@azure/identity-broker\";\n *\n * // Load the plugin\n * useIdentityPlugin(nativeBrokerPlugin);\n * ```\n */\n\nexport const nativeBrokerPlugin: IdentityPlugin = (context: unknown) => {\n const { nativeBrokerPluginControl } = context as AzurePluginContext;\n const brokerPlugin = new NativeBrokerPlugin();\n nativeBrokerPluginControl.setNativeBroker(brokerPlugin);\n};\n"],"names":["NativeBrokerPlugin"],"mappings":";;;;;;AAAA;AACA;AAMA;;;;;;;;;;;;;;;AAeG;AAEU,MAAA,kBAAkB,GAAmB,CAAC,OAAgB,KAAI;AACrE,IAAA,MAAM,EAAE,yBAAyB,EAAE,GAAG,OAA6B,CAAC;AACpE,IAAA,MAAM,YAAY,GAAG,IAAIA,qCAAkB,EAAE,CAAC;AAC9C,IAAA,yBAAyB,CAAC,eAAe,CAAC,YAAY,CAAC,CAAC;AAC1D;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/identity-broker",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0",
4
4
  "sdk-type": "client",
5
5
  "description": "A native plugin for Azure Identity credentials to enable broker authentication such as WAM",
6
6
  "main": "dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "LICENSE"
39
39
  ],
40
40
  "engines": {
41
- "node": ">=16.0.0"
41
+ "node": ">=18.0.0"
42
42
  },
43
43
  "repository": "github:Azure/azure-sdk-for-js",
44
44
  "keywords": [
@@ -58,9 +58,9 @@
58
58
  "sideEffects": false,
59
59
  "dependencies": {
60
60
  "@azure/core-auth": "^1.4.0",
61
- "@azure/identity": "4.0.0-beta.1",
62
- "@azure/msal-node": "^2.3.0",
63
- "@azure/msal-node-extensions": "^1.0.5",
61
+ "@azure/identity": "^4.0.0",
62
+ "@azure/msal-node": "^2.5.1",
63
+ "@azure/msal-node-extensions": "^1.0.7",
64
64
  "tslib": "^2.2.0"
65
65
  },
66
66
  "devDependencies": {
@@ -73,7 +73,7 @@
73
73
  "@azure-tools/test-recorder": "^3.0.0",
74
74
  "@microsoft/api-extractor": "^7.35.1",
75
75
  "@types/mocha": "^10.0.0",
76
- "@types/node": "^14.0.0",
76
+ "@types/node": "^18.0.0",
77
77
  "@types/sinon": "^10.0.15",
78
78
  "@types/wtfnode": "0.7.2",
79
79
  "cross-env": "^7.0.2",