Skip to content

Commit 6e345ed

Browse files
committed
Updated all include files
Edited all include files and ran Acrolinx to align with current standards
1 parent 03ab59e commit 6e345ed

File tree

8 files changed

+155
-138
lines changed

8 files changed

+155
-138
lines changed

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

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,24 @@ ms.author: dademath
1818
- 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

21-
## Setting up
21+
## Set up your environment
2222

2323
### Add the extension
24-
Add the Azure Communication Services extension for Azure CLI by using the `az extension` command.
24+
25+
Add the Azure Communication Services extension for Azure CLI using the `az extension` command.
2526

2627
```azurecli-interactive
2728
az extension add --name communication
2829
```
2930

3031
### Sign in to Azure CLI
31-
You'll need to [sign in to Azure CLI](/cli/azure/authenticate-azure-cli). You can sign in running the ```az login``` command from the terminal and providing your credentials.
32+
33+
You need to [sign in to Azure CLI](/cli/azure/authenticate-azure-cli). You can sign in running the ```az login``` command from the terminal, then provide your credentials.
3234

3335

3436
### (Optional) Use Azure CLI identity operations without passing in a connection string
3537

36-
You can configure the `AZURE_COMMUNICATION_CONNECTION_STRING` environment variable to use Azure CLI identity operations without having to use `--connection_string` to pass in the connection string. To configure an environment variable, open a console window and select your operating system from the below tabs. Replace `<yourConnectionString>` with your actual connection string.
38+
You can configure the `AZURE_COMMUNICATION_CONNECTION_STRING` environment variable to use Azure CLI identity operations without having to use `--connection_string` to pass in the connection string. To configure an environment variable, open a console window and select your operating system from the following tabs. Replace `<yourConnectionString>` with your actual connection string.
3739

3840
#### [Windows](#tab/windows)
3941

@@ -43,7 +45,7 @@ Open a console window and enter the following command:
4345
setx AZURE_COMMUNICATION_CONNECTION_STRING "<yourConnectionString>"
4446
```
4547

46-
After you add the environment variable, you may need to restart any running programs that will need to read the environment variable, including the console window. For example, if you're using Visual Studio as your editor, restart Visual Studio before running the example.
48+
After you add the environment variable, you might need to restart any running programs that need to read the environment variable, including the console window. For example, if you're using Visual Studio as your editor, restart Visual Studio before running the example.
4749

4850
#### [macOS](#tab/unix)
4951

@@ -53,7 +55,7 @@ Edit your **`.zshrc`**, and add the environment variable:
5355
export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"
5456
```
5557

56-
After you add the environment variable, run `source ~/.zshrc` from your console window to make the changes effective. If you created the environment variable with your IDE open, you may need to close and reopen the editor, IDE, or shell in order to access the variable.
58+
After you add the environment variable, run `source ~/.zshrc` from your console window to make the changes effective. If you created the environment variable with your IDE open, you might need to close and reopen the editor, IDE, or shell in order to access the variable.
5759

5860
#### [Linux](#tab/linux)
5961

@@ -63,7 +65,7 @@ Edit your **`.bash_profile`**, and add the environment variable:
6365
export AZURE_COMMUNICATION_CONNECTION_STRING="<yourConnectionString>"
6466
```
6567

66-
After you add the environment variable, run `source ~/.bash_profile` from your console window to make the changes effective. If you created the environment variable with your IDE open, you may need to close and reopen the editor, IDE, or shell in order to access the variable.
68+
After you add the environment variable, run `source ~/.bash_profile` from your console window to make the changes effective. If you created the environment variable with your IDE open, you might need to close and reopen the editor, IDE, or shell in order to access the variable.
6769

6870
---
6971

@@ -79,7 +81,7 @@ Open a console window and enter the following command:
7981
setx AZURE_COMMUNICATION_ACCESS_TOKEN "<yourAccessToken>"
8082
```
8183

82-
After you add the environment variable, you may need to restart any running programs that will need to read the environment variable, including the console window. For example, if you're using Visual Studio as your editor, restart Visual Studio before running the example.
84+
After you add the environment variable, you might need to restart any running programs that need to read the environment variable, including the console window. For example, if you're using Visual Studio as your editor, restart Visual Studio before running the example.
8385

8486
#### [macOS](#tab/unix)
8587

@@ -89,7 +91,7 @@ Edit your **`.zshrc`**, and add the environment variable:
8991
export AZURE_COMMUNICATION_ACCESS_TOKEN="<yourAccessToken>"
9092
```
9193

92-
After you add the environment variable, run `source ~/.zshrc` from your console window to make the changes effective. If you created the environment variable with your IDE open, you may need to close and reopen the editor, IDE, or shell in order to access the variable.
94+
After you add the environment variable, run `source ~/.zshrc` from your console window to make the changes effective. If you created the environment variable with your IDE open, you might need to close and reopen the editor, IDE, or shell in order to access the variable.
9395

9496
#### [Linux](#tab/linux)
9597

@@ -99,7 +101,7 @@ Edit your **`.bash_profile`**, and add the environment variable:
99101
export AZURE_COMMUNICATION_ACCESS_TOKEN="<yourAccessToken>"
100102
```
101103

102-
After you add the environment variable, run `source ~/.bash_profile` from your console window to make the changes effective. If you created the environment variable with your IDE open, you may need to close and reopen the editor, IDE, or shell in order to access the variable.
104+
After you add the environment variable, run `source ~/.bash_profile` from your console window to make the changes effective. If you created the environment variable with your IDE open, you might need to close and reopen the editor, IDE, or shell in order to access the variable.
103105

104106
---
105107

@@ -159,7 +161,7 @@ Access tokens are short-lived credentials that need to be reissued. Not doing so
159161

160162
<a name='exchange-an-azure-ad-access-token-of-the-teams-user-for-a-communication-identity-access-token'></a>
161163

162-
### Exchange a Microsoft Entra access token of the Teams User for a Communication Identity access token
164+
### Exchange a Microsoft Entra access token of the Teams user for a Communication Identity access token
163165

164166
Use the `token get-for-teams-user` command to issue an access token for the Teams user that can be used with the Azure Communication Services SDKs.
165167

@@ -171,12 +173,12 @@ Make this replacement in the code:
171173

172174
- Replace `<yourConnectionString>` with your connection string.
173175
- Replace `<yourAadUser>` with your Microsoft Entra userId.
174-
- Replace `<yourAadApplication>` with your Microsoft Entra application Id.
176+
- Replace `<yourAadApplication>` with your Microsoft Entra application ID.
175177
- Replace `<yourAadToken>` with your Microsoft Entra access token.
176178

177179
### Revoke access tokens
178180

179-
You might occasionally need to explicitly revoke an access token. For example, you would do so when application users change the password they use to authenticate to your service. The `token revoke` command invalidates all active access tokens that were issued to the identity.
181+
You might need to explicitly revoke an access token. For example, you would do so when application users change the password they use to authenticate to your service. The `token revoke` command invalidates all active access tokens that were issued to the identity.
180182

181183
```azurecli-interactive
182184
az communication identity token revoke --user "<userId>" --connection-string "<yourConnectionString>"
@@ -189,7 +191,7 @@ Make this replacement in the code:
189191

190192
### Delete an identity
191193

192-
When you delete an identity, you revoke all active access tokens and prevent the further issuance of access tokens for the identity. Doing so also removes all persisted content that's associated with the identity.
194+
When you delete an identity, you revoke all active access tokens and prevent the further issuance of access tokens for the identity. Doing so also removes all persisted content associated with the identity.
193195

194196
```azurecli-interactive
195197
az communication identity user delete --user "<userId>" --connection-string "<yourConnectionString>"

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

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,20 @@ ms.custom: mode-other
1515

1616
## Prerequisites
1717

18-
- An [Azure Communication Services resource](../../../create-communication-resource.md)
18+
- An [Azure Communication Services resource](../../../create-communication-resource.md).
1919

2020
## Create the access tokens
2121

22-
In the [Azure portal](https://portal.azure.com), navigate to the **Identities & User Access Tokens** blade within your Communication Services resource.
22+
1. In the [Azure portal](https://portal.azure.com), navigate to the **Identities & User Access Tokens** blade in your Communication Services resource.
2323

24-
Choose the scope of the access tokens. You can select none, one, or multiple. Click **Generate**.
24+
2. Choose the scope of the access tokens. You can choose none, one, or multiple services.
2525

26-
![Select the scopes of the identity and access tokens.](../../media/quick-create-identity-choose-scopes.png)
26+
3. Select **Generate**.
2727

28-
You'll see an identity and corresponding user access token generated. You can copy these strings and use them in the [sample apps](../../../../samples/overview.md) and other testing scenarios.
28+
:::image type="content" source="../../media/quick-create-identity-choose-scopes.png" alt-text="Screenshot that shows the scopes of the identity and access tokens where you select Generate." lightbox="../../media/quick-create-identity-choose-scopes.png":::
2929

30-
![The identity and access tokens are generated and show the expiration date.](../../media/quick-create-identity-generated.png)
30+
The system generates an identity and corresponding user access token.
31+
32+
4. Copy these strings and use them in the [sample apps](../../../../samples/overview.md) and other testing scenarios.
33+
34+
:::image type="content" source="../../media/quick-create-identity-generated.png" alt-text="Screenshot that shows the identity and access tokens with expiration date" lightbox="../../media/quick-create-identity-generated.png":::

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

Lines changed: 34 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,24 @@ ms.author: tchladek
2020
- An active Communication Services resource and connection string. [Create a Communication Services resource](../../../create-communication-resource.md).
2121

2222
## Final code
23-
Find the finalized code for this quickstart on [GitHub](https://github.com/Azure-Samples/communication-services-java-quickstarts/tree/main/access-token-quickstart).
23+
24+
Find the finalized code at [GitHub](https://github.com/Azure-Samples/communication-services-java-quickstarts/tree/main/access-token-quickstart).
2425

2526
## Set up your environment
2627

2728
### Create a new Java application
2829

29-
In a terminal or Command Prompt window, go to the directory where you want to create your Java application. To generate a Java project from the maven-archetype-quickstart template, run the following code:
30+
In a terminal or command prompt window, go to the directory where you want to create your Java application. To generate a Java project from the maven-archetype-quickstart template, run the following code:
3031

3132
```console
3233
mvn archetype:generate -DgroupId=com.communication.quickstart -DartifactId=communication-quickstart -DarchetypeArtifactId=maven-archetype-quickstart -DarchetypeVersion=1.4 -DinteractiveMode=false
3334
```
3435

35-
You'll notice that the `generate` task creates a directory with the same name as `artifactId`. Under this directory, the *src/main/java* directory contains the project source code, the *src/test/java* directory contains the test source, and the *pom.xml* file is the project's Project Object Model, or POM. This file is used for project configuration parameters.
36+
Notice that the `generate` task creates a directory with the same name as `artifactId`. Under this directory, the `src/main/java` directory contains the project source code, the `src/test/java` directory contains the test source, and the `pom.xml` file is the project's Project Object Model, or POM. This file is used for project configuration parameters.
3637

3738
### Install the Communication Services packages
3839

39-
Open the *pom.xml* file in your text editor. Add the following dependency element to the group of dependencies:
40+
Open the `pom.xml` file in your text editor. Add the following dependency element to the group of dependencies:
4041

4142
```xml
4243
<dependency>
@@ -46,14 +47,14 @@ Open the *pom.xml* file in your text editor. Add the following dependency elemen
4647
</dependency>
4748
```
4849

49-
This code instructs Maven to install the Communication Services Identity SDK, which you'll use later.
50+
This code instructs Maven to install the Communication Services Identity SDK, which you need to use later.
5051

5152
### Set up the app framework
5253

53-
In the project directory, do the following:
54+
In the project directory, complete the following steps:
5455

55-
1. Go to the */src/main/java/com/communication/quickstart* directory.
56-
1. Open the *App.java* file in your editor.
56+
1. Go to the `/src/main/java/com/communication/quickstart` directory.
57+
1. Open the `App.java` file in your editor.
5758
1. Replace the `System.out.println("Hello world!");` statement.
5859
1. Add `import` directives.
5960

@@ -83,11 +84,11 @@ public class App
8384

8485
## Authenticate the client
8586

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).
87+
Instantiate a `CommunicationIdentityClient` with your resource's access key and endpoint. For more information, see [Create and manage Communication Services resources > Store your connection string](../../../create-communication-resource.md#store-your-connection-string).
8788

88-
In addition, you can initialize the client with any custom HTTP client that implements the `com.azure.core.http.HttpClient` interface.
89+
You can also initialize the client with any custom HTTP client that implements the `com.azure.core.http.HttpClient` interface.
8990

90-
In the *App.java* file, add the following code to the `main` method:
91+
In the `App.java` file, add the following code to the `main` method:
9192

9293
```java
9394
// You can find your endpoint and access key from your resource in the Azure portal
@@ -111,7 +112,7 @@ CommunicationIdentityClient communicationIdentityClient = new CommunicationIdent
111112
.buildClient();
112113
```
113114

114-
If you've already set up a Microsoft Entra application, you can [authenticate by using Microsoft Entra ID](../../../identity/service-principal.md).
115+
If you already set up a Microsoft Entra application, you can [authenticate by using Microsoft Entra ID](../../../identity/service-principal.md).
115116

116117
```java
117118
String endpoint = "https://<RESOURCE_NAME>.communication.azure.com";
@@ -132,7 +133,7 @@ CommunicationUserIdentifier user = communicationIdentityClient.createUser();
132133
System.out.println("\nCreated an identity with ID: " + user.getId());
133134
```
134135

135-
The created identity is required later for issuing access tokens. Store the received identity with mapping to your application's users (for example, by storing it in your application server database).
136+
The created identity is required later to issue access tokens. Store the received identity with mapping to your application's users (for example, by storing it in your application server database).
136137

137138
## Issue an access token
138139

@@ -149,11 +150,11 @@ String token = accessToken.getToken();
149150
System.out.println("\nIssued an access token with 'voip' scope that expires at: " + expiresAt + ": " + token);
150151
```
151152

152-
Access tokens are short-lived credentials that need to be reissued. Not doing so might cause a disruption of your application users' experience. The `expiresAt` property indicates the lifetime of the access token.
153+
Access tokens are short-lived credentials that need to be reissued. Not doing so might cause a disruption of your application user experience. The `expiresAt` property indicates the lifetime of the access token.
153154

154155
## Set a custom token expiration time
155156

156-
The default token expiration time is 24 hours, but you can configure it by providing a value between an hour and 24 hours to the optional parameter `tokenExpiresIn`. When requesting a new token, it's recommended that you specify the expected typical length of a communication session for the token expiration time.
157+
The default token expiration time is 24 hours, but you can configure it by providing a value between an hour and 24 hours to the optional parameter `tokenExpiresIn`. When requesting a new token, specify the expected typical length of a communication session for the token expiration time.
157158

158159
```java
159160
// Issue an access token with a validity of an hour and the "voip" scope for a user identity
@@ -164,8 +165,7 @@ AccessToken accessToken = communicationIdentityClient.getToken(user, scopes, tok
164165

165166
## Create an identity and issue a token in one request
166167

167-
Alternatively, you can use the 'createUserAndToken' method to create a new entry in the directory with a unique `Id` and
168-
issue an access token at the same time.
168+
Alternatively, you can use the 'createUserAndToken' method to create a new entry in the directory with a unique `Id` and issue an access token at the same time.
169169

170170
```java
171171
//Create an identity and issue token with a validity of 24 hours in one call
@@ -191,7 +191,7 @@ AccessToken response = communicationIdentityClient.getToken(identity, scopes);
191191

192192
## Revoke an access token
193193

194-
You might occasionally need to explicitly revoke an access token. For example, you would do so when application users change the password they use to authenticate to your service. The `revokeTokens` method invalidates all active access tokens for a particular user. In the following code, you can use the previously created user.
194+
You might need to explicitly revoke an access token. For example, you would do so when application users change the password they use to authenticate to your service. The `revokeTokens` method invalidates all active access tokens for a particular user. In the following code, you can use the previously created user.
195195

196196
```java
197197
communicationIdentityClient.revokeTokens(user);
@@ -200,7 +200,7 @@ System.out.println("\nSuccessfully revoked all access tokens for user identity w
200200

201201
## Delete an identity
202202

203-
When you delete an identity, you revoke all active access tokens and prevent the further issuance of access tokens for the identity. Doing so also removes all persisted content that's associated with the identity.
203+
When you delete an identity, you revoke all active access tokens and prevent the further issuance of access tokens for the identity. Doing so also removes all persisted content associated with the identity.
204204

205205
```java
206206
communicationIdentityClient.deleteUser(user);
@@ -209,25 +209,27 @@ System.out.println("\nDeleted the user identity with ID: " + user.getId());
209209

210210
## Run the code
211211

212-
Go to the directory that contains the *pom.xml* file, and then compile the project by using the following `mvn` command:
212+
1. Go to the directory that contains the `pom.xml` file.
213213

214-
```console
215-
mvn compile
216-
```
214+
2. Compile the project using the following `mvn` command:
217215

218-
Then, build the package:
216+
```console
217+
mvn compile
218+
```
219219

220-
```console
221-
mvn package
222-
```
220+
3. build the package:
223221

224-
Run the following `mvn` command to execute the app:
222+
```console
223+
mvn package
224+
```
225225

226-
```console
227-
mvn exec:java -Dexec.mainClass="com.communication.quickstart.App" -Dexec.cleanupDaemonThreads=false
228-
```
226+
4. Run the following `mvn` command to execute the app:
227+
228+
```console
229+
mvn exec:java -Dexec.mainClass="com.communication.quickstart.App" -Dexec.cleanupDaemonThreads=false
230+
```
229231

230-
The app's output describes each completed action:
232+
The output describes each completed action:
231233

232234
<!---cSpell:disable --->
233235
```console

0 commit comments

Comments
 (0)