Skip to content

Commit 63e4d7b

Browse files
authored
Merge pull request #100676 from ms-avocado/patch-2
Added missing `name` field in `InsecureTokenProvider` instance creation
2 parents 4f78bc8 + 583ef58 commit 63e4d7b

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

articles/azure-fluid-relay/how-tos/connect-fluid-azure-service.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,14 @@ The sections below will explain how to use `AzureClient` in your own application
2626
To connect to an Azure Fluid Relay instance, you first need to create an `AzureClient`. You must provide some configuration parameters including the tenant ID, service URL, and a token provider to generate the JSON Web Token (JWT) that will be used to authorize the current user against the service. The [@fluidframework/test-client-utils](https://fluidframework.com/docs/apis/test-client-utils/) package provides an [InsecureTokenProvider](https://fluidframework.com/docs/apis/test-client-utils/insecuretokenprovider-class) that can be used for development purposes.
2727

2828
> [!CAUTION]
29-
> The `InsecureTokenProvider` should only be used for development purposes because **using it exposes the tenant key secret in your client-side code bundle.** This must be replaced with an implementation of [ITokenProvider](https://fluidframework.com/docs/apis/azure-client/itokenprovider-interface/) that fetches the token from your own backend service that is responsible for signing it with the tenant key. An example implementation is [AzureFunctionTokenProvider](https://fluidframework.com/docs/apis/azure-client/azurefunctiontokenprovider-class). For more information, see [How to: Write a TokenProvider with an Azure Function](../how-tos/azure-function-token-provider.md).
29+
> The `InsecureTokenProvider` should only be used for development purposes because **using it exposes the tenant key secret in your client-side code bundle.** This must be replaced with an implementation of [ITokenProvider](https://fluidframework.com/docs/apis/azure-client/itokenprovider-interface/) that fetches the token from your own backend service that is responsible for signing it with the tenant key. An example implementation is [AzureFunctionTokenProvider](https://fluidframework.com/docs/apis/azure-client/azurefunctiontokenprovider-class). For more information, see [How to: Write a TokenProvider with an Azure Function](../how-tos/azure-function-token-provider.md). Note that the `id` and `name` fields are arbitrary.
3030
3131
```javascript
32+
const user = { id: "userId", name: "userName" };
33+
3234
const config = {
3335
tenantId: "myTenantId",
34-
tokenProvider: new InsecureTokenProvider("myTenantKey", { id: "userId" }),
36+
tokenProvider: new InsecureTokenProvider("myTenantKey", user),
3537
endpoint: "https://myServiceEndpointUrl",
3638
type: "remote",
3739
};

articles/azure-fluid-relay/quickstarts/quickstart-dice-roll.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,15 @@ import { InsecureTokenProvider } from "@fluidframework/test-client-utils";
5757
import { AzureClient } from "@fluidframework/azure-client";
5858
```
5959
To configure the Azure client, replace the local connection `serviceConfig` object in `app.js` with your Azure Fluid Relay
60-
service configuration values. These values can be found in the "Access Key" section of the Fluid Relay resource in the Azure portal. Your `serviceConfig` object should look like this with the values replaced. (For information about how to find these values, see [How to: Provision an Azure Fluid Relay service](../how-tos/provision-fluid-azure-portal.md).)
60+
service configuration values. These values can be found in the "Access Key" section of the Fluid Relay resource in the Azure portal. Your `serviceConfig` object should look like this with the values replaced. (For information about how to find these values, see [How to: Provision an Azure Fluid Relay service](../how-tos/provision-fluid-azure-portal.md).) Note that the `id` and `name` fields are arbitrary.
6161

6262
```javascript
63+
const user = { id: "userId", name: "userName" };
64+
6365
const serviceConfig = {
6466
connection: {
6567
tenantId: "MY_TENANT_ID", // REPLACE WITH YOUR TENANT ID
66-
tokenProvider: new InsecureTokenProvider("" /* REPLACE WITH YOUR PRIMARY KEY */, { id: "userId" }),
68+
tokenProvider: new InsecureTokenProvider("" /* REPLACE WITH YOUR PRIMARY KEY */, user),
6769
endpoint: "https://myServiceEndpointUrl", // REPLACE WITH YOUR SERVICE ENDPOINT
6870
type: "remote",
6971
}

0 commit comments

Comments
 (0)