CommunicationIdentityAsyncClient Class

  • java.lang.Object
    • com.azure.communication.identity.CommunicationIdentityAsyncClient

public final class CommunicationIdentityAsyncClient

Asynchronous client interface for Azure Communication Services Identity operations

Instantiating an asynchronous Azure Communication Service Identity Client

// You can find your endpoint and access key from your resource in the Azure Portal
 String endpoint = "https://<RESOURCE_NAME>.communication.azure.com";
 AzureKeyCredential keyCredential = new AzureKeyCredential("<access-key>");

 CommunicationIdentityAsyncClient communicationIdentityAsyncClient = new CommunicationIdentityClientBuilder()
         .endpoint(endpoint)
         .credential(keyCredential)
         .buildAsyncClient();

View CommunicationIdentityClientBuilder for additional ways to construct the client.

Method Summary

Modifier and Type Method and Description
Mono<CommunicationUserIdentifier> createUser()

Creates a new CommunicationUserIdentifier.

Mono<CommunicationUserIdentifierAndToken> createUserAndToken(Iterable<CommunicationTokenScope> scopes)

Creates a new CommunicationUserIdentifier with token.

Mono<CommunicationUserIdentifierAndToken> createUserAndToken(Iterable<CommunicationTokenScope> scopes, Duration tokenExpiresIn)

Creates a new CommunicationUserIdentifier with token.

Mono<Response<CommunicationUserIdentifierAndToken>> createUserAndTokenWithResponse(Iterable<CommunicationTokenScope> scopes)

Creates a new CommunicationUserIdentifier with token with response.

Mono<Response<CommunicationUserIdentifierAndToken>> createUserAndTokenWithResponse(Iterable<CommunicationTokenScope> scopes, Duration tokenExpiresIn)

Creates a new CommunicationUserIdentifier with token with response.

Mono<Response<CommunicationUserIdentifier>> createUserWithResponse()

Creates a new CommunicationUserIdentifier with response.

Mono<Void> deleteUser(CommunicationUserIdentifier communicationUser)

Deletes a CommunicationUserIdentifier, revokes its tokens and deletes its data.

Mono<Response<Void>> deleteUserWithResponse(CommunicationUserIdentifier communicationUser)

Deletes a CommunicationUserIdentifier, revokes its tokens and deletes its data with response.

Mono<AccessToken> getToken(CommunicationUserIdentifier communicationUser, Iterable<CommunicationTokenScope> scopes)

Gets a Communication Identity access token for a CommunicationUserIdentifier.

Mono<AccessToken> getToken(CommunicationUserIdentifier communicationUser, Iterable<CommunicationTokenScope> scopes, Duration tokenExpiresIn)

Gets a Communication Identity access token for a CommunicationUserIdentifier.

Mono<AccessToken> getTokenForTeamsUser(GetTokenForTeamsUserOptions options)

Exchanges an Azure AD access token of a Teams User for a new Communication Identity access token.

Mono<Response<AccessToken>> getTokenForTeamsUserWithResponse(GetTokenForTeamsUserOptions options)

Exchanges an Azure AD access token of a Teams User for a new Communication Identity access token.

Mono<Response<AccessToken>> getTokenWithResponse(CommunicationUserIdentifier communicationUser, Iterable<CommunicationTokenScope> scopes)

Gets a Communication Identity access token for a CommunicationUserIdentifier.

Mono<Response<AccessToken>> getTokenWithResponse(CommunicationUserIdentifier communicationUser, Iterable<CommunicationTokenScope> scopes, Duration tokenExpiresIn)

Gets a Communication Identity access token for a CommunicationUserIdentifier.

Mono<Void> revokeTokens(CommunicationUserIdentifier communicationUser)

Revokes all the tokens created for an identifier.

Mono<Response<Void>> revokeTokensWithResponse(CommunicationUserIdentifier communicationUser)

Revokes all the tokens created for an identifier with response.

Methods inherited from java.lang.Object

Method Details

createUser

public Mono<CommunicationUserIdentifier> createUser()

Creates a new CommunicationUserIdentifier.

Returns:

The created communication user.

createUserAndToken

public Mono<CommunicationUserIdentifierAndToken> createUserAndToken(Iterable<CommunicationTokenScope> scopes)

Creates a new CommunicationUserIdentifier with token.

Parameters:

scopes - The list of scopes for the token.

Returns:

The created communication user and token.

createUserAndToken

public Mono<CommunicationUserIdentifierAndToken> createUserAndToken(Iterable<CommunicationTokenScope> scopes, Duration tokenExpiresIn)

Creates a new CommunicationUserIdentifier with token.

Parameters:

scopes - The list of scopes for the token.
tokenExpiresIn - Custom validity period of the Communication Identity access token within [1,24] hours range. If not provided, the default value of 24 hours will be used.

Returns:

The created communication user and token.

createUserAndTokenWithResponse

public Mono<Response<CommunicationUserIdentifierAndToken>> createUserAndTokenWithResponse(Iterable<CommunicationTokenScope> scopes)

Creates a new CommunicationUserIdentifier with token with response.

Parameters:

scopes - The list of scopes for the token.

Returns:

The result with created communication user and token with response.

createUserAndTokenWithResponse

public Mono<Response<CommunicationUserIdentifierAndToken>> createUserAndTokenWithResponse(Iterable<CommunicationTokenScope> scopes, Duration tokenExpiresIn)

Creates a new CommunicationUserIdentifier with token with response.

Parameters:

scopes - The list of scopes for the token.
tokenExpiresIn - Custom validity period of the Communication Identity access token within [1,24] hours range. If not provided, the default value of 24 hours will be used.

Returns:

The result with created communication user and token with response.

createUserWithResponse

public Mono<Response<CommunicationUserIdentifier>> createUserWithResponse()

Creates a new CommunicationUserIdentifier with response.

Returns:

The created communication user with response.

deleteUser

public Mono<Void> deleteUser(CommunicationUserIdentifier communicationUser)

Deletes a CommunicationUserIdentifier, revokes its tokens and deletes its data.

Parameters:

communicationUser - The user to be deleted.

Returns:

A reactive response signalling completion.

deleteUserWithResponse

public Mono<Response<Void>> deleteUserWithResponse(CommunicationUserIdentifier communicationUser)

Deletes a CommunicationUserIdentifier, revokes its tokens and deletes its data with response.

Parameters:

communicationUser - The user to be deleted.

Returns:

The response with void.

getToken

public Mono<AccessToken> getToken(CommunicationUserIdentifier communicationUser, Iterable<CommunicationTokenScope> scopes)

Gets a Communication Identity access token for a CommunicationUserIdentifier.

Parameters:

communicationUser - A CommunicationUserIdentifier from whom to issue a Communication Identity access token.
scopes - List of CommunicationTokenScope scopes for the Communication Identity access token.

Returns:

the Communication Identity access token.

getToken

public Mono<AccessToken> getToken(CommunicationUserIdentifier communicationUser, Iterable<CommunicationTokenScope> scopes, Duration tokenExpiresIn)

Gets a Communication Identity access token for a CommunicationUserIdentifier.

Parameters:

communicationUser - A CommunicationUserIdentifier from whom to issue a Communication Identity access token.
scopes - List of CommunicationTokenScope scopes for the Communication Identity access token.
tokenExpiresIn - Custom validity period of the Communication Identity access token within [1,24] hours range. If not provided, the default value of 24 hours will be used.

Returns:

the Communication Identity access token.

getTokenForTeamsUser

public Mono<AccessToken> getTokenForTeamsUser(GetTokenForTeamsUserOptions options)

Exchanges an Azure AD access token of a Teams User for a new Communication Identity access token.

Parameters:

options - GetTokenForTeamsUserOptions request options used to exchange an Azure AD access token of a Teams User for a new Communication Identity access token.

Returns:

Communication Identity access token.

getTokenForTeamsUserWithResponse

public Mono<Response<AccessToken>> getTokenForTeamsUserWithResponse(GetTokenForTeamsUserOptions options)

Exchanges an Azure AD access token of a Teams User for a new Communication Identity access token.

Parameters:

options - GetTokenForTeamsUserOptions request options used to exchange an Azure AD access token of a Teams User for a new Communication Identity access token.

Returns:

Communication Identity access token with response.

getTokenWithResponse

public Mono<Response<AccessToken>> getTokenWithResponse(CommunicationUserIdentifier communicationUser, Iterable<CommunicationTokenScope> scopes)

Gets a Communication Identity access token for a CommunicationUserIdentifier.

Parameters:

communicationUser - A CommunicationUserIdentifier from whom to issue a Communication Identity access token.
scopes - List of CommunicationTokenScope scopes for the Communication Identity access token.

Returns:

the Communication Identity access token with response.

getTokenWithResponse

public Mono<Response<AccessToken>> getTokenWithResponse(CommunicationUserIdentifier communicationUser, Iterable<CommunicationTokenScope> scopes, Duration tokenExpiresIn)

Gets a Communication Identity access token for a CommunicationUserIdentifier.

Parameters:

communicationUser - A CommunicationUserIdentifier from whom to issue a Communication Identity access token.
scopes - List of CommunicationTokenScope scopes for the Communication Identity access token.
tokenExpiresIn - Custom validity period of the Communication Identity access token within [1,24] hours range. If not provided, the default value of 24 hours will be used.

Returns:

the Communication Identity access token with response.

revokeTokens

public Mono<Void> revokeTokens(CommunicationUserIdentifier communicationUser)

Revokes all the tokens created for an identifier.

Parameters:

communicationUser - The user to be revoked access tokens.

Returns:

A reactive response signalling completion.

revokeTokensWithResponse

public Mono<Response<Void>> revokeTokensWithResponse(CommunicationUserIdentifier communicationUser)

Revokes all the tokens created for an identifier with response.

Parameters:

communicationUser - The user to be revoked tokens.

Returns:

The response with void.

Applies to