共用方式為


CommunicationIdentityClient class

用來與 Azure 通訊服務使用者令牌管理互動的客戶端類別。

建構函式

CommunicationIdentityClient(string, CommunicationIdentityClientOptions)

初始化 CommunicationIdentity 類別的新實例。

CommunicationIdentityClient(string, KeyCredential, CommunicationIdentityClientOptions)

使用 Azure KeyCredential 初始化 CommunicationIdentity 類別的新實例。

CommunicationIdentityClient(string, TokenCredential, CommunicationIdentityClientOptions)

使用 TokenCredential 初始化 CommunicationIdentity 類別的新實例。

方法

createUser(OperationOptions)

建立單一使用者。

createUserAndToken(TokenScope[], CreateUserAndTokenOptions)

同時建立單一使用者和令牌。

deleteUser(CommunicationUserIdentifier, OperationOptions)

觸發使用者的撤銷事件,並刪除其所有數據。

getToken(CommunicationUserIdentifier, TokenScope[], GetTokenOptions)

建立限定範圍的使用者令牌。

getTokenForTeamsUser(GetTokenForTeamsUserOptions)

以相符的到期時間交換 Teams 使用者的 Azure AD 存取令牌,以取得新的通訊身分識別存取令牌。

revokeTokens(CommunicationUserIdentifier, OperationOptions)

撤銷為使用者建立的所有數據和令牌。

建構函式詳細資料

CommunicationIdentityClient(string, CommunicationIdentityClientOptions)

初始化 CommunicationIdentity 類別的新實例。

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

參數

connectionString

string

聯機至 Azure 通訊服務資源的連接字串。 範例:“endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret“;

options
CommunicationIdentityClientOptions

自選。 設定 HTTP 管線的選項。

CommunicationIdentityClient(string, KeyCredential, CommunicationIdentityClientOptions)

使用 Azure KeyCredential 初始化 CommunicationIdentity 類別的新實例。

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

參數

endpoint

string

服務的端點(例如:https://contoso.eastus.communications.azure.net)。

credential
KeyCredential

對象,用來驗證對服務的要求。 使用 AzureKeyCredential 或 @azure/identity 來建立認證。

options
CommunicationIdentityClientOptions

自選。 設定 HTTP 管線的選項。

CommunicationIdentityClient(string, TokenCredential, CommunicationIdentityClientOptions)

使用 TokenCredential 初始化 CommunicationIdentity 類別的新實例。

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

參數

endpoint

string

服務的端點 (例如:https://contoso.eastus.communications.azure.net

credential
TokenCredential

用來驗證服務要求的 TokenCredential。

options
CommunicationIdentityClientOptions

自選。 設定 HTTP 管線的選項。

方法詳細資料

createUser(OperationOptions)

建立單一使用者。

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

參數

options
OperationOptions

要求的其他選項。

傳回

createUserAndToken(TokenScope[], CreateUserAndTokenOptions)

同時建立單一使用者和令牌。

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

參數

scopes

TokenScope[]

要包含在令牌中的範圍。

options
CreateUserAndTokenOptions

要求的其他選項。

傳回

deleteUser(CommunicationUserIdentifier, OperationOptions)

觸發使用者的撤銷事件,並刪除其所有數據。

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

參數

user
CommunicationUserIdentifier

正在刪除的使用者。

options
OperationOptions

要求的其他選項。

傳回

Promise<void>

getToken(CommunicationUserIdentifier, TokenScope[], GetTokenOptions)

建立限定範圍的使用者令牌。

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

參數

user
CommunicationUserIdentifier

要發行其令牌的使用者。

scopes

TokenScope[]

要包含在令牌中的範圍。

options
GetTokenOptions

要求的其他選項。

傳回

getTokenForTeamsUser(GetTokenForTeamsUserOptions)

以相符的到期時間交換 Teams 使用者的 Azure AD 存取令牌,以取得新的通訊身分識別存取令牌。

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

參數

options
GetTokenForTeamsUserOptions

用來交換 Teams 使用者的 Azure AD 存取令牌的選項,以取得新的通訊身分識別存取令牌。

傳回

revokeTokens(CommunicationUserIdentifier, OperationOptions)

撤銷為使用者建立的所有數據和令牌。

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

參數

user
CommunicationUserIdentifier

要撤銷其令牌的使用者。

options
OperationOptions

要求的其他選項。

傳回

Promise<void>