azure.communication.identity.aio package¶
-
class
azure.communication.identity.aio.
CommunicationIdentityClient
(endpoint: str, credential: str, **kwargs: Any)[source]¶ Azure Communication Services Identity client.
- Parameters
endpoint (str) – The endpoint url for Azure Communication Service resource.
credential – The credentials with which to authenticate. The value is an account shared access key
Example:
-
async
close
() → None[source]¶ Close the :class: ~azure.communication.identity.aio.CommunicationIdentityClient session.
-
async
create_user
(**kwargs) → azure.communication.identity._shared.models.CommunicationUserIdentifier[source]¶ create a single Communication user
- Returns
CommunicationUserIdentifier
- Return type
-
async
create_user_with_token
(scopes: List[Union[str, ‘_model.CommunicationTokenScope’]], **kwargs: Any) → Tuple[CommunicationUserIdentifier, AccessToken][source]¶ create a single Communication user with an identity token. :param scopes:
List of scopes to be added to the token.
- Returns
A tuple of a CommunicationUserIdentifier and a AccessToken.
- Return type
tuple of (CommunicationUserIdentifier, AccessToken)
-
async
delete_user
(communication_user: CommunicationUserIdentifier, **kwargs: Any) → None[source]¶ Triggers revocation event for user and deletes all its data.
- Parameters
communication_user (CommunicationUserIdentifier) – Azure Communication User to delete
- Returns
None
- Return type
-
classmethod
from_connection_string
(conn_str: str, **kwargs: Any) → CommunicationIdentityClient[source]¶ Create CommunicationIdentityClient from a Connection String.
- Parameters
conn_str (str) – A connection string to an Azure Communication Service resource.
- Returns
Instance of CommunicationIdentityClient.
- Return type
Example:
-
async
issue_token
(user: CommunicationUserIdentifier, scopes: List[Union[str, ‘_model.CommunicationTokenScope’]], **kwargs: Any) → AccessToken[source]¶ Generates a new token for an identity.
- Parameters
user (CommunicationUserIdentifier) – Azure Communication User
scopes (list[str or CommunicationTokenScope]) – List of scopes to be added to the token.
- Returns
AccessToken
- Return type
-
async
revoke_tokens
(user: CommunicationUserIdentifier, **kwargs: Any) → None[source]¶ Schedule revocation of all tokens of an identity.
- Parameters
user (CommunicationUserIdentifier) – Azure Communication User.
- Returns
None
- Return type