Skip to content

Commit 4ee7262

Browse files
petrsvihlikjovannikolov-msft
authored andcommitted
[Hub Generated] Review request for Identity to add version preview/2021-10-31-preview (Azure#16014)
* Adds base for updating Identity from version preview/2021-03-31-preview1 to version 2021-10-31-preview * Updates readme * Updates API version in new specs and examples * Added a new swagger + examples for ACS Identity Swagger for 2021-10-31-preview * JSONs prettified * Fixed naming of tokens participating in the token exchange AAD access token of a Teams User - for the token that is being exchanged (the input token) Communication Identity access token - for the token for which the ^token is being exchanged (the output token) * API Review notes incorporated Added a note about the expiration time of the token as requested by Dominik Messinger during the API review
1 parent 64b19c9 commit 4ee7262

File tree

7 files changed

+474
-6
lines changed

7 files changed

+474
-6
lines changed
Lines changed: 374 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,374 @@
1+
{
2+
"swagger": "2.0",
3+
"info": {
4+
"title": "CommunicationIdentityClient",
5+
"description": "Azure Communication Identity Service",
6+
"version": "2021-10-31-preview"
7+
},
8+
"paths": {
9+
"/identities": {
10+
"post": {
11+
"tags": [
12+
"Identity"
13+
],
14+
"summary": "Create a new identity, and optionally, an access token.",
15+
"operationId": "CommunicationIdentity_Create",
16+
"consumes": [
17+
"application/json"
18+
],
19+
"produces": [
20+
"application/json"
21+
],
22+
"parameters": [
23+
{
24+
"$ref": "#/parameters/ApiVersionParameter"
25+
},
26+
{
27+
"in": "body",
28+
"name": "body",
29+
"description": "If specified, creates also a Communication Identity access token associated with the identity and containing the requested scopes.",
30+
"schema": {
31+
"$ref": "#/definitions/CommunicationIdentityCreateRequest"
32+
}
33+
}
34+
],
35+
"responses": {
36+
"default": {
37+
"description": "Error",
38+
"schema": {
39+
"$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
40+
}
41+
},
42+
"201": {
43+
"description": "Created - Returns the created identity.",
44+
"schema": {
45+
"$ref": "#/definitions/CommunicationIdentityAccessTokenResult"
46+
}
47+
}
48+
},
49+
"x-ms-examples": {
50+
"Create an Identity": {
51+
"$ref": "./examples/CreateIdentity.json"
52+
}
53+
}
54+
}
55+
},
56+
"/identities/{id}": {
57+
"delete": {
58+
"tags": [
59+
"Identity"
60+
],
61+
"summary": "Delete the identity, revoke all tokens for the identity and delete all associated data.",
62+
"operationId": "CommunicationIdentity_Delete",
63+
"produces": [
64+
"application/json"
65+
],
66+
"parameters": [
67+
{
68+
"in": "path",
69+
"name": "id",
70+
"description": "Identifier of the identity to be deleted.",
71+
"required": true,
72+
"type": "string"
73+
},
74+
{
75+
"$ref": "#/parameters/ApiVersionParameter"
76+
}
77+
],
78+
"responses": {
79+
"default": {
80+
"description": "Error",
81+
"schema": {
82+
"$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
83+
}
84+
},
85+
"204": {
86+
"description": "Success"
87+
}
88+
},
89+
"x-ms-examples": {
90+
"Delete an identity": {
91+
"$ref": "./examples/DeleteIdentity.json"
92+
}
93+
}
94+
}
95+
},
96+
"/identities/{id}/:revokeAccessTokens": {
97+
"post": {
98+
"tags": [
99+
"Identity"
100+
],
101+
"summary": "Revoke all access tokens for the specific identity.",
102+
"operationId": "CommunicationIdentity_RevokeAccessTokens",
103+
"produces": [
104+
"application/json"
105+
],
106+
"parameters": [
107+
{
108+
"in": "path",
109+
"name": "id",
110+
"description": "Identifier of the identity.",
111+
"required": true,
112+
"type": "string"
113+
},
114+
{
115+
"$ref": "#/parameters/ApiVersionParameter"
116+
}
117+
],
118+
"responses": {
119+
"default": {
120+
"description": "Error",
121+
"schema": {
122+
"$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
123+
}
124+
},
125+
"204": {
126+
"description": "Success"
127+
}
128+
},
129+
"x-ms-examples": {
130+
"Revoke access tokens": {
131+
"$ref": "./examples/RevokeAccessTokens.json"
132+
}
133+
}
134+
}
135+
},
136+
"/teamsUser/:exchangeAccessToken": {
137+
"post": {
138+
"tags": [
139+
"TeamsUser"
140+
],
141+
"summary": "Exchange an AAD access token of a Teams user for a new Communication Identity access token with a matching expiration time.",
142+
"operationId": "CommunicationIdentity_ExchangeTeamsUserAccessToken",
143+
"consumes": [
144+
"application/json"
145+
],
146+
"produces": [
147+
"application/json"
148+
],
149+
"parameters": [
150+
{
151+
"$ref": "#/parameters/ApiVersionParameter"
152+
},
153+
{
154+
"in": "body",
155+
"name": "body",
156+
"description": "AAD access token of a Teams user",
157+
"required": true,
158+
"schema": {
159+
"$ref": "#/definitions/TeamsUserAccessTokenRequest"
160+
}
161+
}
162+
],
163+
"responses": {
164+
"default": {
165+
"description": "Error",
166+
"schema": {
167+
"$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
168+
}
169+
},
170+
"200": {
171+
"description": "Success",
172+
"schema": {
173+
"$ref": "#/definitions/CommunicationIdentityAccessToken"
174+
}
175+
}
176+
},
177+
"x-ms-examples": {
178+
"Exchange a Teams user access token": {
179+
"$ref": "./examples/ExchangeTeamsUserAccessToken.json"
180+
}
181+
}
182+
}
183+
},
184+
"/identities/{id}/:issueAccessToken": {
185+
"post": {
186+
"tags": [
187+
"Token"
188+
],
189+
"summary": "Issue a new token for an identity.",
190+
"operationId": "CommunicationIdentity_IssueAccessToken",
191+
"consumes": [
192+
"application/json"
193+
],
194+
"produces": [
195+
"application/json"
196+
],
197+
"parameters": [
198+
{
199+
"in": "path",
200+
"name": "id",
201+
"description": "Identifier of the identity to issue token for.",
202+
"required": true,
203+
"type": "string"
204+
},
205+
{
206+
"$ref": "#/parameters/ApiVersionParameter"
207+
},
208+
{
209+
"in": "body",
210+
"name": "body",
211+
"description": "Requested scopes for the new token.",
212+
"required": true,
213+
"schema": {
214+
"$ref": "#/definitions/CommunicationIdentityAccessTokenRequest"
215+
}
216+
}
217+
],
218+
"responses": {
219+
"default": {
220+
"description": "Error",
221+
"schema": {
222+
"$ref": "../../../Common/stable/2021-03-07/common.json#/definitions/CommunicationErrorResponse"
223+
}
224+
},
225+
"200": {
226+
"description": "Success",
227+
"schema": {
228+
"$ref": "#/definitions/CommunicationIdentityAccessToken"
229+
}
230+
}
231+
},
232+
"x-ms-examples": {
233+
"Issue an access token": {
234+
"$ref": "./examples/IssueAccessToken.json"
235+
}
236+
}
237+
}
238+
}
239+
},
240+
"definitions": {
241+
"CommunicationIdentity": {
242+
"description": "A communication identity.",
243+
"required": [
244+
"id"
245+
],
246+
"type": "object",
247+
"properties": {
248+
"id": {
249+
"description": "Identifier of the identity.",
250+
"type": "string"
251+
}
252+
}
253+
},
254+
"CommunicationIdentityAccessToken": {
255+
"description": "An access token.",
256+
"required": [
257+
"expiresOn",
258+
"token"
259+
],
260+
"type": "object",
261+
"properties": {
262+
"token": {
263+
"description": "The access token issued for the identity.",
264+
"type": "string"
265+
},
266+
"expiresOn": {
267+
"format": "date-time",
268+
"description": "The expiry time of the token.",
269+
"type": "string"
270+
}
271+
}
272+
},
273+
"CommunicationIdentityAccessTokenRequest": {
274+
"required": [
275+
"scopes"
276+
],
277+
"type": "object",
278+
"properties": {
279+
"scopes": {
280+
"description": "List of scopes attached to the token.",
281+
"type": "array",
282+
"items": {
283+
"$ref": "#/definitions/CommunicationIdentityTokenScope"
284+
}
285+
}
286+
}
287+
},
288+
"CommunicationIdentityAccessTokenResult": {
289+
"description": "A communication identity with access token.",
290+
"required": [
291+
"identity"
292+
],
293+
"type": "object",
294+
"properties": {
295+
"identity": {
296+
"$ref": "#/definitions/CommunicationIdentity"
297+
},
298+
"accessToken": {
299+
"$ref": "#/definitions/CommunicationIdentityAccessToken"
300+
}
301+
}
302+
},
303+
"CommunicationIdentityCreateRequest": {
304+
"type": "object",
305+
"properties": {
306+
"createTokenWithScopes": {
307+
"description": "Also create access token for the created identity.",
308+
"type": "array",
309+
"items": {
310+
"$ref": "#/definitions/CommunicationIdentityTokenScope"
311+
}
312+
}
313+
}
314+
},
315+
"CommunicationIdentityTokenScope": {
316+
"description": "List of scopes for an access token.",
317+
"enum": [
318+
"chat",
319+
"voip"
320+
],
321+
"type": "string",
322+
"x-ms-enum": {
323+
"name": "CommunicationIdentityTokenScope",
324+
"modelAsString": true
325+
}
326+
},
327+
"TeamsUserAccessTokenRequest": {
328+
"required": [
329+
"token"
330+
],
331+
"type": "object",
332+
"properties": {
333+
"token": {
334+
"description": "AAD access token of a Teams User to acquire a new Communication Identity access token.",
335+
"type": "string"
336+
}
337+
}
338+
}
339+
},
340+
"parameters": {
341+
"ApiVersionParameter": {
342+
"in": "query",
343+
"name": "api-version",
344+
"description": "Version of API to invoke.",
345+
"required": true,
346+
"type": "string"
347+
}
348+
},
349+
"securityDefinitions": {
350+
"azure_auth": {
351+
"type": "oauth2",
352+
"flow": "implicit",
353+
"authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize",
354+
"scopes": {
355+
"user_impersonation": "impersonate your user account"
356+
}
357+
}
358+
},
359+
"x-ms-parameterized-host": {
360+
"hostTemplate": "{endpoint}",
361+
"useSchemePrefix": false,
362+
"parameters": [
363+
{
364+
"name": "endpoint",
365+
"description": "The communication resource, for example https://my-resource.communication.azure.com",
366+
"required": true,
367+
"type": "string",
368+
"in": "path",
369+
"x-ms-skip-url-encoding": true,
370+
"x-ms-parameter-location": "client"
371+
}
372+
]
373+
}
374+
}

0 commit comments

Comments
 (0)