CommunicationIdentityClient Class

Azure Communication Services Identity client.

Inheritance
builtins.object
CommunicationIdentityClient

Constructor

CommunicationIdentityClient(endpoint: str, credential: str, **kwargs: Any)

Parameters

endpoint
str
Required

The endpoint url for Azure Communication Service resource.

credential
Required

The credentials with which to authenticate. The value is an account shared access key

Methods

close

Close the :class: ~azure.communication.administration.aio.CommunicationIdentityClient session.

create_user

create a single Communication user

return: CommunicationUser rtype: ~azure.communication.administration.CommunicationUser

delete_user

Triggers revocation event for user and deletes all its data.

from_connection_string

Create CommunicationIdentityClient from a Connection String.

issue_token

Generates a new token for an identity.

revoke_tokens

Schedule revocation of all tokens of an identity.

close

Close the :class: ~azure.communication.administration.aio.CommunicationIdentityClient session.

async close() -> None

create_user

create a single Communication user

return: CommunicationUser rtype: ~azure.communication.administration.CommunicationUser

async create_user(**kwargs) -> azure.communication.administration._shared.models.CommunicationUser

delete_user

Triggers revocation event for user and deletes all its data.

async delete_user(communication_user: CommunicationUser, **kwargs: Any) -> None

Parameters

communication_user
CommunicationUser
Required

Azure Communication User to delete

Returns

None

Return type

from_connection_string

Create CommunicationIdentityClient from a Connection String.

from_connection_string(conn_str: str, **kwargs: Any) -> CommunicationIdentityClient

Parameters

conn_str
str
Required

A connection string to an Azure Communication Service resource.

conn_str
Required

Returns

Instance of CommunicationIdentityClient.

Return type

<xref:azure.communication.aio.CommunicationIdentityClient>

issue_token

Generates a new token for an identity.

async issue_token(user: CommunicationUser, scopes: List[str], **kwargs: Any) -> CommunicationIdentityToken

Parameters

user
CommunicationUser
Required

Azure Communication User

scopes
list[str]
Required

List of scopes to be added to the token.

Returns

CommunicationIdentityToken

Return type

revoke_tokens

Schedule revocation of all tokens of an identity.

async revoke_tokens(user: CommunicationUser, issued_before: Optional[datetime.datetime] = None, **kwargs: Any) -> None

Parameters

user
CommunicationUser
Required

Azure Communication User.

issued_before
datetime
Required

All tokens that are issued prior to this time should get revoked.

Returns

None

Return type