CommunicationIdentityClient class
Client class for interacting with Azure Communication Services User Token Management.
Constructors
Communication |
Initializes a new instance of the CommunicationIdentity class. |
Communication |
Initializes a new instance of the CommunicationIdentity class using an Azure KeyCredential. |
Communication |
Initializes a new instance of the CommunicationIdentity class using a TokenCredential. |
Methods
create |
Creates a single user. |
delete |
Triggers revocation event for user and deletes all its data. |
issue |
Creates a scoped user token. |
revoke |
Revokes all data and tokens created for a user. |
Constructor Details
CommunicationIdentityClient(string, CommunicationIdentityOptions)
Initializes a new instance of the CommunicationIdentity class.
new CommunicationIdentityClient(connectionString: string, options?: CommunicationIdentityOptions)
Parameters
- connectionString
-
string
Connection string to connect to an Azure Communication Service resource. Example: "endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret";
- options
- CommunicationIdentityOptions
Optional. Options to configure the HTTP pipeline.
CommunicationIdentityClient(string, KeyCredential, CommunicationIdentityOptions)
Initializes a new instance of the CommunicationIdentity class using an Azure KeyCredential.
new CommunicationIdentityClient(url: string, credential: KeyCredential, options?: CommunicationIdentityOptions)
Parameters
- url
-
string
The endpoint of the service (ex: https://contoso.eastus.communications.azure.net).
- credential
- KeyCredential
An object that is used to authenticate requests to the service. Use the AzureKeyCredential or @azure/identity
to create a credential.
- options
- CommunicationIdentityOptions
Optional. Options to configure the HTTP pipeline.
CommunicationIdentityClient(string, TokenCredential, CommunicationIdentityOptions)
Initializes a new instance of the CommunicationIdentity class using a TokenCredential.
new CommunicationIdentityClient(url: string, credential: TokenCredential, options?: CommunicationIdentityOptions)
Parameters
- url
-
string
The endpoint of the service (ex: https://contoso.eastus.communications.azure.net)
- credential
- TokenCredential
TokenCredential that is used to authenticate requests to the service.
- options
- CommunicationIdentityOptions
Optional. Options to configure the HTTP pipeline.
Method Details
createUser(OperationOptions)
Creates a single user.
function createUser(options?: OperationOptions): Promise<CreateUserResponse>
Parameters
- options
- OperationOptions
Additional options for the request.
Returns
Promise<CreateUserResponse>
deleteUser(CommunicationUserIdentifier, OperationOptions)
Triggers revocation event for user and deletes all its data.
function deleteUser(user: CommunicationUserIdentifier, options?: OperationOptions): Promise<{ _response: HttpResponse }>
Parameters
The user being deleted.
- options
- OperationOptions
Additional options for the request.
Returns
Promise<{ _response: HttpResponse }>
issueToken(CommunicationUserIdentifier, TokenScope[], OperationOptions)
Creates a scoped user token.
function issueToken(user: CommunicationUserIdentifier, scopes: TokenScope[], options?: OperationOptions): Promise<IssueTokenResponse>
Parameters
The user whose tokens are being revoked.
- scopes
Scopes to include in the token.
- options
- OperationOptions
Additional options for the request.
Returns
Promise<IssueTokenResponse>
revokeTokens(CommunicationUserIdentifier, Date, OperationOptions)
Revokes all data and tokens created for a user.
function revokeTokens(user: CommunicationUserIdentifier, tokensValidFrom?: Date, options?: OperationOptions): Promise<{ _response: HttpResponse }>
Parameters
The user whose tokens are being revoked.
- tokensValidFrom
-
Date
Tokens issued before this time will be revoked.
- options
- OperationOptions
Additional options for the request.
Returns
Promise<{ _response: HttpResponse }>
Azure SDK for JavaScript
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for