Skip to content

Commit 722ce97

Browse files
[identity] update docs, readme and TS guide for broker feature (Azure#27637)
1 parent 1eef2c9 commit 722ce97

File tree

15 files changed

+111
-43
lines changed

15 files changed

+111
-43
lines changed

common/config/rush/pnpm-lock.yaml

Lines changed: 29 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/identity/identity-broker/CHANGELOG.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# Release History
22

3-
## 1.0.0-beta.2 (Unreleased)
3+
## 1.0.0 (2023-11-06)
44

55
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
6+
- First GA release of the plugin package `@azure/identity-broker` to [support authentication through broker such as WAM](https://learn.microsoft.com/azure/active-directory/develop/scenario-desktop-acquire-token-wam). This plugin works with the [`brokerOptions` on `InteractiveBrowserCredential` added in the `@azure/identity` package](https://github.com/Azure/azure-sdk-for-js/pull/26091/).
127

138
## 1.0.0-beta.1 (2023-10-23)
149

sdk/identity/identity-broker/README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# Azure Identity plugin for brokered authentication
22

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).
44

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/)
68

79
## Getting started
810

@@ -34,6 +36,22 @@ Azure Identity plugins for JavaScript support stable (even numbered) versions of
3436

3537
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.
3638

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+
3755
### Azure Identity plugins
3856

3957
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() {
6785
const credential = new InteractiveBrowserCredential({
6886
brokerOptions: {
6987
enabled: true,
88+
parentWindowHandle: <insert_current_window_handle>
7089
},
7190
});
7291

@@ -82,9 +101,12 @@ main().catch((error) => {
82101
process.exit(1);
83102
});
84103
```
104+
For an example of using Electron app for retrieving a window handle, check [this sample](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity-broker/samples/v1-beta/typescript/src/index.ts).
85105

86106
## Troubleshooting
87107

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+
88110
### Logging
89111

90112
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`:

sdk/identity/identity-broker/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@azure/identity-broker",
3-
"version": "1.0.0-beta.2",
3+
"version": "1.0.0",
44
"sdk-type": "client",
55
"description": "A native plugin for Azure Identity credentials to enable broker authentication such as WAM",
66
"main": "dist/index.js",
@@ -58,7 +58,7 @@
5858
"sideEffects": false,
5959
"dependencies": {
6060
"@azure/core-auth": "^1.4.0",
61-
"@azure/identity": "4.0.0-beta.2",
61+
"@azure/identity": "^4.0.0",
6262
"@azure/msal-node": "^2.3.0",
6363
"@azure/msal-node-extensions": "^1.0.5",
6464
"tslib": "^2.2.0"

sdk/identity/identity-broker/samples/v1-beta/typescript/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* packages for WAM MSA support.
77
*/
88

9-
import { InteractiveBrowserCredential, useIdentityPlugin } from "@azure/identity";
9+
import { InteractiveBrowserCredential, InteractiveBrowserCredentialNodeOptions, useIdentityPlugin } from "@azure/identity";
1010
import { nativeBrokerPlugin } from "@azure/identity-broker";
1111
import { setLogLevel } from "@azure/logger";
1212

@@ -50,7 +50,7 @@ app.on("ready", async () => {
5050
parentWindowHandle: winHandle,
5151
legacyEnableMsaPassthrough: true,
5252
},
53-
});
53+
} as InteractiveBrowserCredentialNodeOptions);
5454

5555
// This is the scope we will use to get a token from the Microsoft Entra token endpoint.
5656
// By default, we'll use the Microsoft Graph scope as an example, but when

sdk/identity/identity-cache-persistence/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"sideEffects": false,
6161
"dependencies": {
6262
"@azure/core-auth": "^1.5.0",
63-
"@azure/identity": "4.0.0-beta.2",
63+
"@azure/identity": "^4.0.0",
6464
"@azure/msal-node": "^2.3.0",
6565
"@azure/msal-node-extensions": "1.0.0-alpha.25",
6666
"keytar": "^7.6.0",

sdk/identity/identity/CHANGELOG.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
# Release History
22

3-
## 4.0.0-beta.2 (Unreleased)
3+
## 4.0.0 (2023-11-06)
44

55
### Features Added
6+
- All the features shipped as part of 4.0.0-beta.1 will be GA with this version. The most important feature being the support of brokered authentication on Windows OS, such as WAM.
67

78
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
9+
- Starting with v4.0.0 of `@azure/identity`, Node.js v20 will be supported and Node.js v16 will no longer be supported.
1210

1311
## 4.0.0-beta.1 (2023-10-26)
1412

0 commit comments

Comments
 (0)