Skip to content

Commit 92f11fc

Browse files
authored
Update identifiers-ios.md
1 parent c32274f commit 92f11fc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

articles/communication-services/concepts/includes/identifiers/identifiers-ios.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,34 @@ let gcchTeamsAppIdentifier = MicrosoftTeamsAppIdentifier(appId: botId, cloudEnvi
8888

8989
[MicrosoftTeamsAppIdentifier](https://azure.github.io/azure-sdk-for-ios/AzureCommunicationCommon/Classes/MicrosoftTeamsAppIdentifier.html)
9090

91+
### Teams Extension user
92+
93+
The `TeamsExtensionUserIdentifier` interface represents a Teams user enabled for Teams Phone Extensibility. A `TeamsExtensionUserIdentifier` requires the Microsoft Entra user object ID of the Teams user, the Microsoft Entra tenant ID where the user resides and the Azure Communication Services resource ID. You can retrieve the Microsoft Entra user object ID via the [Microsoft Graph REST API /users](/graph/api/user-get) endpoint from the `id` property in the response and the Microsoft Entra tenant ID via the [Microsoft Graph REST API /organization](/graph/api/organization-get) endpoint from the `id` property in the response. For more information about working with Microsoft Graph, see [Graph Explorer](https://developer.microsoft.com/en-us/graph/graph-explorer?request=users%2F%7Buser-mail%7D&method=GET&version=v1.0&GraphUrl=https://graph.microsoft.com) and look into the [Graph SDK](/graph/sdks/sdks-overview).
94+
Alternatively, you can find the object ID as the `oid` claim and the tenant ID as the `tid` claim in an [Microsoft Entra token](/entra/identity-platform/id-token-claims-reference#payload-claims) or [Microsoft Entra access token](/entra/identity-platform/access-token-claims-reference#payload-claims) after your user signed in and acquired a token.
95+
96+
#### Basic usage
97+
98+
```swift
99+
// get the Teams user's ID if only the email is known, assuming a helper method for the Graph API
100+
let userId = await getUserIdFromGraph("[email protected]")
101+
102+
// get the tenantId from Graph API
103+
let tenantId = await getTenantIdFromGraph()
104+
105+
// Communication Services Resource ID
106+
let resourceId = "<resource-id-guid>";
107+
108+
// create an identifier
109+
let teamsExtensionUser = TeamsExtensionUserIdentifier(userId: userId, tenantId: tenantId, resourceId: resourceId)
110+
111+
// if you're not operating in the public cloud, you must also pass the right Cloud type.
112+
let gcchTeamsExtensionUser = TeamsExtensionUserIdentifier(userId: userId, tenantId: tenantId, resourceId: resourceId, cloudEnvironment: CommunicationCloudEnvironment.Gcch)
113+
```
114+
115+
#### API reference
116+
117+
[MicrosoftTeamsUserIdentifier](https://azure.github.io/azure-sdk-for-ios/AzureCommunicationCommon/Classes/TeamsExtensionUserIdentifier.html)
118+
91119
### Unknown
92120

93121
The `UnknownIdentifier` exists for future-proofing and you might encounter it when you are on an old version of the SDK and a new identifier type is recently introduced. Any unknown identifier from the service deserializes to `UnknownIdentifier` in the SDK.

0 commit comments

Comments
 (0)