Skip to content

Commit d0f5ad1

Browse files
committed
fixes 3
1 parent 5585531 commit d0f5ad1

File tree

7 files changed

+31
-25
lines changed

7 files changed

+31
-25
lines changed

articles/communication-services/.openpublishing.redirection.communication-services.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@
153153
"source_path_from_root": "/articles/communication-services/quickstarts/identity/service-principal-from-cli.md",
154154
"redirect_url": "/azure/communication-services/quickstarts/identity/service-principal",
155155
"redirect_document_id": false
156+
},
157+
{
158+
"source_path_from_root": "/articles/communication-services/quickstarts/identity/access-token-teams-external-users.md",
159+
"redirect_url": "/azure/communication-services/quickstarts/identity/access-tokens",
160+
"redirect_document_id": false
156161
}
157162
]
158163
}

articles/communication-services/quickstarts/identity/includes/access-tokens/access-token-az-cli.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@ ms.author: dademath
1515
## Prerequisites
1616

1717
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
18-
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../create-communication-resource.md?#access-your-connection-strings-and-service-endpoints-using-azure-cli).
18+
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../../create-communication-resource.md?#access-your-connection-strings-and-service-endpoints-using-azure-cli).
1919
- Install [Azure CLI](/cli/azure/install-azure-cli-windows?tabs=azure-cli).
2020

2121
## Setting up
22+
2223
### Add the extension
2324
Add the Azure Communication Services extension for Azure CLI by using the `az extension` command.
2425

@@ -116,7 +117,7 @@ az communication identity user create --connection-string "<yourConnectionString
116117

117118
### Create an identity and issue an access token in the same request
118119

119-
Run the following command to create a Communication Services identity and issue an access token for it at the same time. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Authenticate to Azure Communication Services](../../../concepts/authentication.md).
120+
Run the following command to create a Communication Services identity and issue an access token for it at the same time. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Authenticate to Azure Communication Services](../../../../concepts/authentication.md).
120121

121122
```azurecli-interactive
122123
az communication identity token issue --scope chat --connection-string "<yourConnectionString>"
@@ -128,7 +129,7 @@ Make this replacement in the code:
128129

129130
### Issue access token
130131

131-
Run the following command to issue an access token for your Communication Services identity. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Authenticate to Azure Communication Services](../../../concepts/authentication.md).
132+
Run the following command to issue an access token for your Communication Services identity. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Authenticate to Azure Communication Services](../../../../concepts/authentication.md).
132133

133134
```azurecli-interactive
134135
az communication identity token issue --scope chat --user "<userId>" --connection-string "<yourConnectionString>"
@@ -143,7 +144,7 @@ Access tokens are short-lived credentials that need to be reissued. Not doing so
143144

144145
### Issue access token with multiple scopes
145146

146-
Run the following command to issue an access token with multiple scopes for your Communication Services identity. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Identity model](../../../concepts/identity-model.md#access-tokens).
147+
Run the following command to issue an access token with multiple scopes for your Communication Services identity. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Identity model](../../../../concepts/identity-model.md#access-tokens).
147148

148149
```azurecli-interactive
149150
az communication identity token issue --scope chat voip --user "<userId>" --connection-string "<yourConnectionString>"

articles/communication-services/quickstarts/identity/includes/access-tokens/access-token-java.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.author: tchladek
1717
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
1818
- [Java Development Kit (JDK)](/azure/developer/java/fundamentals/java-jdk-install) version 8 or later.
1919
- [Apache Maven](https://maven.apache.org/download.cgi).
20-
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../create-communication-resource.md).
20+
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../../create-communication-resource.md).
2121

2222
## Final code
2323
Find the finalized code for this quickstart on [GitHub](https://github.com/Azure-Samples/communication-services-java-quickstarts/tree/main/access-token-quickstart).
@@ -83,7 +83,7 @@ public class App
8383

8484
## Authenticate the client
8585

86-
Instantiate a `CommunicationIdentityClient` with your resource's access key and endpoint. For more information, see the "Store your connection string" section of [Create and manage Communication Services resources](../../create-communication-resource.md#store-your-connection-string).
86+
Instantiate a `CommunicationIdentityClient` with your resource's access key and endpoint. For more information, see the "Store your connection string" section of [Create and manage Communication Services resources](../../../create-communication-resource.md#store-your-connection-string).
8787

8888
In addition, you can initialize the client with any custom HTTP client that implements the `com.azure.core.http.HttpClient` interface.
8989

@@ -111,7 +111,7 @@ CommunicationIdentityClient communicationIdentityClient = new CommunicationIdent
111111
.buildClient();
112112
```
113113

114-
If you've already set up an Azure Active Directory (Azure AD) application, you can [authenticate by using Azure AD](../../identity/service-principal.md).
114+
If you've already set up an Azure Active Directory (Azure AD) application, you can [authenticate by using Azure AD](../../../identity/service-principal.md).
115115

116116
```java
117117
String endpoint = "https://<RESOURCE_NAME>.communication.azure.com";
@@ -136,7 +136,7 @@ The created identity is required later for issuing access tokens. Store the rece
136136

137137
## Issue an access token
138138

139-
Use the `getToken` method to issue an access token for your Communication Services identity. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Identity model](../../../concepts/identity-model.md#access-tokens).
139+
Use the `getToken` method to issue an access token for your Communication Services identity. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Identity model](../../../../concepts/identity-model.md#access-tokens).
140140

141141
In the following code, use the user variable that you created in the preceding step to get a token.
142142

articles/communication-services/quickstarts/identity/includes/access-tokens/access-token-js.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.author: tchladek
1616

1717
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
1818
- [Node.js](https://nodejs.org/) Active LTS and Maintenance LTS versions (8.11.1 and 10.14.1 recommended).
19-
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../create-communication-resource.md).
19+
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../../create-communication-resource.md).
2020

2121
## Final code
2222
Find the finalized code for this quickstart on [GitHub](https://github.com/Azure-Samples/communication-services-javascript-quickstarts/tree/main/access-tokens-quickstart).
@@ -71,7 +71,7 @@ The `--save` option lists the library as a dependency in your *package.json* fil
7171

7272
Instantiate `CommunicationIdentityClient` with your connection string. The following code, which you add to the `Main` method, retrieves the connection string for the resource from an environment variable named `COMMUNICATION_SERVICES_CONNECTION_STRING`.
7373

74-
For more information, see the "Store your connection string" section of [Create and manage Communication Services resources](../../create-communication-resource.md#store-your-connection-string).
74+
For more information, see the "Store your connection string" section of [Create and manage Communication Services resources](../../../create-communication-resource.md#store-your-connection-string).
7575

7676
```javascript
7777
// This code demonstrates how to fetch your connection string
@@ -97,7 +97,7 @@ const tokenCredential = new AzureKeyCredential(accessKey);
9797
const identityClient = new CommunicationIdentityClient(endpoint, tokenCredential)
9898
```
9999

100-
If you've already set up an Azure Active Directory (Azure AD) application, you can [authenticate by using Azure AD](../../identity/service-principal.md).
100+
If you've already set up an Azure Active Directory (Azure AD) application, you can [authenticate by using Azure AD](../../../identity/service-principal.md).
101101
102102
```javascript
103103
const endpoint = process.env["COMMUNICATION_SERVICES_ENDPOINT"];
@@ -117,7 +117,7 @@ Store the received identity with mapping to your application's users (for exampl
117117

118118
## Issue an access token
119119

120-
Use the `getToken` method to issue an access token for your Communication Services identity. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Identity model](../../../concepts/identity-model.md#access-tokens). You can also construct a new instance of a `communicationUser` based on a string representation of the Azure Communication Service identity.
120+
Use the `getToken` method to issue an access token for your Communication Services identity. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Identity model](../../../../concepts/identity-model.md#access-tokens). You can also construct a new instance of a `communicationUser` based on a string representation of the Azure Communication Service identity.
121121

122122
```javascript
123123
// Issue an access token with a validity of 24 hours and the "voip" scope for an identity

articles/communication-services/quickstarts/identity/includes/access-tokens/access-token-net.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ms.author: tchladek
1717

1818
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
1919
- The latest [.NET Core SDK](https://dotnet.microsoft.com/download/dotnet-core) version for your operating system.
20-
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../create-communication-resource.md).
20+
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../../create-communication-resource.md).
2121

2222
## Final code
2323
Find the finalized code for this quickstart on [GitHub](https://github.com/Azure-Samples/communication-services-dotnet-quickstarts/tree/main/AccessTokensQuickstart).
@@ -81,7 +81,7 @@ namespace AccessTokensQuickstart
8181

8282
Initialize `CommunicationIdentityClient` with your connection string. The following code, which you add to the `Main` method, retrieves the connection string for the resource from an environment variable named `COMMUNICATION_SERVICES_CONNECTION_STRING`.
8383

84-
For more information, see the "Store your connection string" section of [Create and manage Communication Services resources](../../create-communication-resource.md#store-your-connection-string).
84+
For more information, see the "Store your connection string" section of [Create and manage Communication Services resources](../../../create-communication-resource.md#store-your-connection-string).
8585

8686
```csharp
8787
// This code demonstrates how to retrieve your connection string
@@ -100,7 +100,7 @@ string accessKey = Environment.GetEnvironmentVariable("COMMUNICATION_SERVICES_AC
100100
var client = new CommunicationIdentityClient(new Uri(endpoint), new AzureKeyCredential(accessKey));
101101
```
102102

103-
If you've already set up an Azure Active Directory (Azure AD) application, you can [authenticate by using Azure AD](../../identity/service-principal.md).
103+
If you've already set up an Azure Active Directory (Azure AD) application, you can [authenticate by using Azure AD](../../../identity/service-principal.md).
104104

105105
```csharp
106106
TokenCredential tokenCredential = new DefaultAzureCredential();
@@ -120,7 +120,7 @@ Store the received identity with mapping to your application's users (for exampl
120120

121121
## Issue an access token
122122

123-
After you have a Communication Services identity, use the `GetToken` method to issue an access token for it. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Identity model](../../../concepts/identity-model.md#access-tokens). You can also construct a new instance of `communicationUser` based on a string representation of an Azure Communication Service identity.
123+
After you have a Communication Services identity, use the `GetToken` method to issue an access token for it. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Identity model](../../../../concepts/identity-model.md#access-tokens). You can also construct a new instance of `communicationUser` based on a string representation of an Azure Communication Service identity.
124124

125125
```csharp
126126
// Issue an access token with a validity of 24 hours and the "voip" scope for an identity
@@ -148,7 +148,7 @@ var tokenResponse = await client.GetTokenAsync(identity, scopes, tokenExpiresIn)
148148

149149
## Create an identity and issue a token in the same request
150150

151-
You can use the `CreateUserAndTokenAsync` method to create a Communication Services identity and issue an access token for it at the same time. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Authenticate to Azure Communication Services](../../../concepts/authentication.md).
151+
You can use the `CreateUserAndTokenAsync` method to create a Communication Services identity and issue an access token for it at the same time. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Authenticate to Azure Communication Services](../../../../concepts/authentication.md).
152152

153153
```csharp
154154
// Issue an identity and an access token with a validity of 24 hours and the "voip" scope for the new identity

articles/communication-services/quickstarts/identity/includes/access-tokens/access-token-python.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ ms.author: tchladek
1616

1717
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
1818
- [Python](https://www.python.org/downloads/) 3.7+.
19-
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../create-communication-resource.md).
19+
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../../create-communication-resource.md).
2020

2121
## Final code
2222

@@ -59,7 +59,7 @@ pip install azure-communication-identity
5959

6060
Instantiate a `CommunicationIdentityClient` with your connection string. The following code, which you add to the `try` block, retrieves the connection string for the resource from an environment variable named `COMMUNICATION_SERVICES_CONNECTION_STRING`.
6161

62-
For more information, see the "Store your connection string" section of [Create and manage Communication Services resources](../../create-communication-resource.md#store-your-connection-string).
62+
For more information, see the "Store your connection string" section of [Create and manage Communication Services resources](../../../create-communication-resource.md#store-your-connection-string).
6363

6464
```python
6565
# This code demonstrates how to retrieve your connection string
@@ -70,7 +70,7 @@ connection_string = os.environ["COMMUNICATION_SERVICES_CONNECTION_STRING"]
7070
client = CommunicationIdentityClient.from_connection_string(connection_string)
7171
```
7272

73-
Alternatively, if you've already set up an Azure Active Directory (Azure AD) application, you can [authenticate by using Azure AD](../../identity/service-principal.md).
73+
Alternatively, if you've already set up an Azure Active Directory (Azure AD) application, you can [authenticate by using Azure AD](../../../identity/service-principal.md).
7474

7575
```python
7676
endpoint = os.environ["COMMUNICATION_SERVICES_ENDPOINT"]
@@ -90,7 +90,7 @@ Store the received identity with mapping to your application's users (for exampl
9090

9191
## Issue an access token
9292

93-
Use the `get_token` method to issue an access token for your Communication Services identity. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Identity model](../../../concepts/identity-model.md#access-tokens). You can also construct a new instance of parameter `CommunicationUserIdentifier` based on a string representation of the Azure Communication Service identity.
93+
Use the `get_token` method to issue an access token for your Communication Services identity. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Identity model](../../../../concepts/identity-model.md#access-tokens). You can also construct a new instance of parameter `CommunicationUserIdentifier` based on a string representation of the Azure Communication Service identity.
9494

9595
```python
9696
# Issue an access token with a validity of 24 hours and the "voip" scope for an identity
@@ -114,7 +114,7 @@ token_result = client.get_token(identity, ["voip"], token_expires_in=token_expir
114114

115115
## Create an identity and issue an access token in the same request
116116

117-
You can use the `create_user_and_token` method to create a Communication Services identity and issue an access token for it at the same time. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Authenticate to Azure Communication Services](../../../concepts/authentication.md).
117+
You can use the `create_user_and_token` method to create a Communication Services identity and issue an access token for it at the same time. The `scopes` parameter defines a set of access token permissions and roles. For more information, see the list of supported actions in [Authenticate to Azure Communication Services](../../../../concepts/authentication.md).
118118

119119
```python
120120
# Issue an identity and an access token with a validity of 24 hours and the "voip" scope for the new identity

0 commit comments

Comments
 (0)