Sdílet prostřednictvím


CommunicationIdentityClient class

Klientská třída pro interakci se správou tokenů uživatele služby Azure Communication Services

Konstruktory

CommunicationIdentityClient(string, CommunicationIdentityClientOptions)

Inicializuje novou instanci CommunicationIdentity třídy.

CommunicationIdentityClient(string, KeyCredential, CommunicationIdentityClientOptions)

Inicializuje novou instanci CommunicationIdentity třídy pomocí Azure KeyCredential.

CommunicationIdentityClient(string, TokenCredential, CommunicationIdentityClientOptions)

Inicializuje novou instanci CommunicationIdentity třídy pomocí TokenCredential.

Metody

createUser(OperationOptions)

Vytvoří jednoho uživatele.

createUserAndToken(TokenScope[], CreateUserAndTokenOptions)

Vytvoří jednoho uživatele a token současně.

deleteUser(CommunicationUserIdentifier, OperationOptions)

Aktivuje událost odvolání uživatele a odstraní všechna její data.

getToken(CommunicationUserIdentifier, TokenScope[], GetTokenOptions)

Vytvoří token uživatele s vymezeným oborem.

getTokenForTeamsUser(GetTokenForTeamsUserOptions)

Vymění přístupový token Azure AD uživatele Teams pro nový přístupový token komunikační identity s odpovídajícím časem vypršení platnosti.

revokeTokens(CommunicationUserIdentifier, OperationOptions)

Odvolá všechna data a tokeny vytvořené pro uživatele.

Podrobnosti konstruktoru

CommunicationIdentityClient(string, CommunicationIdentityClientOptions)

Inicializuje novou instanci CommunicationIdentity třídy.

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

Parametry

connectionString

string

Připojovací řetězec pro připojení k prostředku služby Azure Communication Service. Příklad: "endpoint=https://contoso.eastus.communications.azure.net/; accesskey=secret";

options
CommunicationIdentityClientOptions

Volitelný. Možnosti konfigurace kanálu HTTP

CommunicationIdentityClient(string, KeyCredential, CommunicationIdentityClientOptions)

Inicializuje novou instanci CommunicationIdentity třídy pomocí Azure KeyCredential.

new CommunicationIdentityClient(endpoint: string, credential: KeyCredential, options?: CommunicationIdentityClientOptions)

Parametry

endpoint

string

Koncový bod služby (např. https://contoso.eastus.communications.azure.net).

credential
KeyCredential

Objekt, který se používá k ověření požadavků na službu. K vytvoření přihlašovacích údajů použijte AzureKeyCredential nebo @azure/identity.

options
CommunicationIdentityClientOptions

Volitelný. Možnosti konfigurace kanálu HTTP

CommunicationIdentityClient(string, TokenCredential, CommunicationIdentityClientOptions)

Inicializuje novou instanci CommunicationIdentity třídy pomocí TokenCredential.

new CommunicationIdentityClient(endpoint: string, credential: TokenCredential, options?: CommunicationIdentityClientOptions)

Parametry

endpoint

string

Koncový bod služby (např. https://contoso.eastus.communications.azure.net)

credential
TokenCredential

TokenCredential, který slouží k ověřování požadavků na službu.

options
CommunicationIdentityClientOptions

Volitelný. Možnosti konfigurace kanálu HTTP

Podrobnosti metody

createUser(OperationOptions)

Vytvoří jednoho uživatele.

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

Parametry

options
OperationOptions

Další možnosti požadavku

Návraty

createUserAndToken(TokenScope[], CreateUserAndTokenOptions)

Vytvoří jednoho uživatele a token současně.

function createUserAndToken(scopes: TokenScope[], options?: CreateUserAndTokenOptions): Promise<CommunicationUserToken>

Parametry

scopes

TokenScope[]

Obory, které se mají zahrnout do tokenu.

options
CreateUserAndTokenOptions

Další možnosti požadavku

Návraty

deleteUser(CommunicationUserIdentifier, OperationOptions)

Aktivuje událost odvolání uživatele a odstraní všechna její data.

function deleteUser(user: CommunicationUserIdentifier, options?: OperationOptions): Promise<void>

Parametry

user
CommunicationUserIdentifier

Uživatel, který se odstraňuje.

options
OperationOptions

Další možnosti požadavku

Návraty

Promise<void>

getToken(CommunicationUserIdentifier, TokenScope[], GetTokenOptions)

Vytvoří token uživatele s vymezeným oborem.

function getToken(user: CommunicationUserIdentifier, scopes: TokenScope[], options?: GetTokenOptions): Promise<CommunicationAccessToken>

Parametry

user
CommunicationUserIdentifier

Uživatel, jehož tokeny jsou vystaveny.

scopes

TokenScope[]

Obory, které se mají zahrnout do tokenu.

options
GetTokenOptions

Další možnosti požadavku

Návraty

getTokenForTeamsUser(GetTokenForTeamsUserOptions)

Vymění přístupový token Azure AD uživatele Teams pro nový přístupový token komunikační identity s odpovídajícím časem vypršení platnosti.

function getTokenForTeamsUser(options: GetTokenForTeamsUserOptions): Promise<CommunicationAccessToken>

Parametry

options
GetTokenForTeamsUserOptions

Možnosti použité k výměně přístupového tokenu Azure AD uživatele Teams pro nový přístupový token komunikační identity

Návraty

revokeTokens(CommunicationUserIdentifier, OperationOptions)

Odvolá všechna data a tokeny vytvořené pro uživatele.

function revokeTokens(user: CommunicationUserIdentifier, options?: OperationOptions): Promise<void>

Parametry

user
CommunicationUserIdentifier

Uživatel, jehož tokeny jsou odvolány.

options
OperationOptions

Další možnosti požadavku

Návraty

Promise<void>