Skip to content

Commit bad4e21

Browse files
authored
Update identifiers-java.md
1 parent f60d645 commit bad4e21

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,39 @@ var gcchTeamsAppIdentifier = new MicrosoftTeamsAppIdentifier(bot.id, Communicati
9999

100100
[MicrosoftTeamsAppIdentifier](/java/api/com.azure.communication.common.microsoftteamsappidentifier)
101101

102+
### Teams Extension user
103+
104+
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).
105+
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.
106+
107+
#### Basic usage
108+
109+
```java
110+
// get the Teams user's ID from Graph APIs if only the email is known
111+
var user = graphClient.users("[email protected]")
112+
.buildRequest()
113+
.get();
114+
115+
// get the tenantId from Graph API
116+
OrganizationCollectionPage organizations = graphClient.organization()
117+
.buildRequest()
118+
.get();
119+
String tenantId = organizations.getCurrentPage().get(0).id;
120+
121+
//Communication Services Resource ID
122+
var resourceId = "<resource-id-guid>";
123+
124+
// create an identifier
125+
var teamsExtensionUser = new TeamsExtensionUserIdentifier(user.id, tenantId, resourceId);
126+
127+
// if you're not operating in the public cloud, you must also set the right Cloud type.
128+
var gcchTeamsExtensionUser = new TeamsExtensionUserIdentifier(user.id, tenantId, resourceId).setCloudEnvironment(CommunicationCloudEnvironment.GCCH);
129+
```
130+
131+
#### API reference
132+
133+
[MicrosoftTeamsUserIdentifier](/java/api/com.azure.communication.common.teamsextensionuseridentifier)
134+
102135
### Unknown
103136

104137
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)