You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/communication-services/quickstarts/identity/includes/access-tokens/access-token-az-cli.md
+5-4Lines changed: 5 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,10 +15,11 @@ ms.author: dademath
15
15
## Prerequisites
16
16
17
17
- 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).
Add the Azure Communication Services extension for Azure CLI by using the `az extension` command.
24
25
@@ -116,7 +117,7 @@ az communication identity user create --connection-string "<yourConnectionString
116
117
117
118
### Create an identity and issue an access token in the same request
118
119
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).
120
121
121
122
```azurecli-interactive
122
123
az communication identity token issue --scope chat --connection-string "<yourConnectionString>"
@@ -128,7 +129,7 @@ Make this replacement in the code:
128
129
129
130
### Issue access token
130
131
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).
132
133
133
134
```azurecli-interactive
134
135
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
143
144
144
145
### Issue access token with multiple scopes
145
146
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).
147
148
148
149
```azurecli-interactive
149
150
az communication identity token issue --scope chat voip --user "<userId>" --connection-string "<yourConnectionString>"
- 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).
21
21
22
22
## Final code
23
23
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
83
83
84
84
## Authenticate the client
85
85
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).
87
87
88
88
In addition, you can initialize the client with any custom HTTP client that implements the `com.azure.core.http.HttpClient` interface.
89
89
@@ -111,7 +111,7 @@ CommunicationIdentityClient communicationIdentityClient = new CommunicationIdent
111
111
.buildClient();
112
112
```
113
113
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).
@@ -136,7 +136,7 @@ The created identity is required later for issuing access tokens. Store the rece
136
136
137
137
## Issue an access token
138
138
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).
140
140
141
141
In the following code, use the user variable that you created in the preceding step to get a token.
Copy file name to clipboardExpand all lines: articles/communication-services/quickstarts/identity/includes/access-tokens/access-token-js.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ ms.author: tchladek
16
16
17
17
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
18
18
-[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).
20
20
21
21
## Final code
22
22
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
71
71
72
72
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`.
73
73
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).
75
75
76
76
```javascript
77
77
// This code demonstrates how to fetch your connection string
@@ -97,7 +97,7 @@ const tokenCredential = new AzureKeyCredential(accessKey);
97
97
const identityClient = new CommunicationIdentityClient(endpoint, tokenCredential)
98
98
```
99
99
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).
@@ -117,7 +117,7 @@ Store the received identity with mapping to your application's users (for exampl
117
117
118
118
## Issue an access token
119
119
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 newinstanceof 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 newinstanceof a `communicationUser` based on a string representation of the Azure Communication Service identity.
121
121
122
122
```javascript
123
123
// Issue an access token with a validity of 24 hours and the "voip" scope for an identity
Copy file name to clipboardExpand all lines: articles/communication-services/quickstarts/identity/includes/access-tokens/access-token-net.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@ ms.author: tchladek
17
17
18
18
- An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
19
19
- 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).
21
21
22
22
## Final code
23
23
Find the finalized code for this quickstart on [GitHub](https://github.com/Azure-Samples/communication-services-dotnet-quickstarts/tree/main/AccessTokensQuickstart).
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`.
83
83
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).
85
85
86
86
```csharp
87
87
// This code demonstrates how to retrieve your connection string
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).
@@ -120,7 +120,7 @@ Store the received identity with mapping to your application's users (for exampl
120
120
121
121
## Issue an access token
122
122
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.
124
124
125
125
```csharp
126
126
// Issue an access token with a validity of 24 hours and the "voip" scope for an identity
## Create an identity and issue a token in the same request
150
150
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).
152
152
153
153
```csharp
154
154
// Issue an identity and an access token with a validity of 24 hours and the "voip" scope for the new identity
- 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).
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`.
61
61
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).
63
63
64
64
```python
65
65
# This code demonstrates how to retrieve your connection string
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).
@@ -90,7 +90,7 @@ Store the received identity with mapping to your application's users (for exampl
90
90
91
91
## Issue an access token
92
92
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.
94
94
95
95
```python
96
96
# Issue an access token with a validity of 24 hours and the "voip" scope for an identity
## Create an identity and issue an access token in the same request
116
116
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).
118
118
119
119
```python
120
120
# Issue an identity and an access token with a validity of 24 hours and the "voip" scope for the new identity
0 commit comments