CommunicationIdentityClient class

Klientklass för interaktion med Hantering av användartoken för Azure Communication Services.

Konstruktorer

CommunicationIdentityClient(string, CommunicationIdentityOptions)

Initierar en ny instans av klassen CommunicationIdentity.

CommunicationIdentityClient(string, KeyCredential, CommunicationIdentityOptions)

Initierar en ny instans av klassen CommunicationIdentity med hjälp av en Azure KeyCredential.

CommunicationIdentityClient(string, TokenCredential, CommunicationIdentityOptions)

Initierar en ny instans av klassen CommunicationIdentity med hjälp av en TokenCredential.

Metoder

createUser(OperationOptions)

Skapar en enskild användare.

deleteUser(CommunicationUserIdentifier, OperationOptions)

Utlöser återkallningshändelse för användare och tar bort alla dess data.

issueToken(CommunicationUserIdentifier, TokenScope[], OperationOptions)

Skapar en begränsad användartoken.

revokeTokens(CommunicationUserIdentifier, Date, OperationOptions)

Återkallar alla data och token som skapats för en användare.

Konstruktorinformation

CommunicationIdentityClient(string, CommunicationIdentityOptions)

Initierar en ny instans av klassen CommunicationIdentity.

new CommunicationIdentityClient(connectionString: string, options?: CommunicationIdentityOptions)

Parametrar

connectionString

string

Anslutningssträng för att ansluta till en Azure Communication Service-resurs. Exempel: "endpoint=https://contoso.eastus.communications.azure.net/; accesskey=secret";

options
CommunicationIdentityOptions

Valfritt. Alternativ för att konfigurera HTTP-pipelinen.

CommunicationIdentityClient(string, KeyCredential, CommunicationIdentityOptions)

Initierar en ny instans av klassen CommunicationIdentity med hjälp av en Azure KeyCredential.

new CommunicationIdentityClient(url: string, credential: KeyCredential, options?: CommunicationIdentityOptions)

Parametrar

url

string

Tjänstens slutpunkt (till exempel https://contoso.eastus.communications.azure.net).

credential
KeyCredential

Ett objekt som används för att autentisera begäranden till tjänsten. Använd AzureKeyCredential eller @azure/identity för att skapa en autentiseringsuppgift.

options
CommunicationIdentityOptions

Valfritt. Alternativ för att konfigurera HTTP-pipelinen.

CommunicationIdentityClient(string, TokenCredential, CommunicationIdentityOptions)

Initierar en ny instans av klassen CommunicationIdentity med hjälp av en TokenCredential.

new CommunicationIdentityClient(url: string, credential: TokenCredential, options?: CommunicationIdentityOptions)

Parametrar

url

string

Tjänstens slutpunkt (till exempel https://contoso.eastus.communications.azure.net)

credential
TokenCredential

TokenCredential som används för att autentisera begäranden till tjänsten.

options
CommunicationIdentityOptions

Valfritt. Alternativ för att konfigurera HTTP-pipelinen.

Metodinformation

createUser(OperationOptions)

Skapar en enskild användare.

function createUser(options?: OperationOptions): Promise<CreateUserResponse>

Parametrar

options
OperationOptions

Ytterligare alternativ för begäran.

Returer

deleteUser(CommunicationUserIdentifier, OperationOptions)

Utlöser återkallningshändelse för användare och tar bort alla dess data.

function deleteUser(user: CommunicationUserIdentifier, options?: OperationOptions): Promise<{ _response: HttpResponse }>

Parametrar

user
CommunicationUserIdentifier

Användaren som tas bort.

options
OperationOptions

Ytterligare alternativ för begäran.

Returer

Promise<{ _response: HttpResponse }>

issueToken(CommunicationUserIdentifier, TokenScope[], OperationOptions)

Skapar en begränsad användartoken.

function issueToken(user: CommunicationUserIdentifier, scopes: TokenScope[], options?: OperationOptions): Promise<IssueTokenResponse>

Parametrar

user
CommunicationUserIdentifier

Den användare vars token återkallas.

scopes

TokenScope[]

Omfång som ska ingå i token.

options
OperationOptions

Ytterligare alternativ för begäran.

Returer

revokeTokens(CommunicationUserIdentifier, Date, OperationOptions)

Återkallar alla data och token som skapats för en användare.

function revokeTokens(user: CommunicationUserIdentifier, tokensValidFrom?: Date, options?: OperationOptions): Promise<{ _response: HttpResponse }>

Parametrar

user
CommunicationUserIdentifier

Den användare vars token återkallas.

tokensValidFrom

Date

Token som utfärdats före denna tidpunkt kommer att återkallas.

options
OperationOptions

Ytterligare alternativ för begäran.

Returer

Promise<{ _response: HttpResponse }>