CommunicationIdentityClient class
用來與 Azure 通訊服務使用者令牌管理互動的客戶端類別。
建構函式
Communication |
初始化 CommunicationIdentity 類別的新實例。 |
Communication |
使用 Azure KeyCredential 初始化 CommunicationIdentity 類別的新實例。 |
Communication |
使用 TokenCredential 初始化 CommunicationIdentity 類別的新實例。 |
方法
create |
建立單一使用者。 |
create |
同時建立單一使用者和令牌。 |
delete |
觸發使用者的撤銷事件,並刪除其所有數據。 |
get |
建立限定範圍的使用者令牌。 |
get |
以相符的到期時間交換 Teams 使用者的 Azure AD 存取令牌,以取得新的通訊身分識別存取令牌。 |
revoke |
撤銷為使用者建立的所有數據和令牌。 |
建構函式詳細資料
CommunicationIdentityClient(string, CommunicationIdentityClientOptions)
初始化 CommunicationIdentity 類別的新實例。
new CommunicationIdentityClient(connectionString: string, options?: CommunicationIdentityClientOptions)
參數
- connectionString
-
string
聯機至 Azure 通訊服務資源的連接字串。 範例:“endpoint=https://contoso.eastus.communications.azure.net/;accesskey=secret“;
自選。 設定 HTTP 管線的選項。
CommunicationIdentityClient(string, KeyCredential, CommunicationIdentityClientOptions)
使用 Azure KeyCredential 初始化 CommunicationIdentity 類別的新實例。
new CommunicationIdentityClient(endpoint: string, credential: KeyCredential, options?: CommunicationIdentityClientOptions)
參數
- endpoint
-
string
- credential
- KeyCredential
對象,用來驗證對服務的要求。 使用 AzureKeyCredential 或 @azure/identity
來建立認證。
自選。 設定 HTTP 管線的選項。
CommunicationIdentityClient(string, TokenCredential, CommunicationIdentityClientOptions)
使用 TokenCredential 初始化 CommunicationIdentity 類別的新實例。
new CommunicationIdentityClient(endpoint: string, credential: TokenCredential, options?: CommunicationIdentityClientOptions)
參數
- endpoint
-
string
- credential
- TokenCredential
用來驗證服務要求的 TokenCredential。
自選。 設定 HTTP 管線的選項。
方法詳細資料
createUser(OperationOptions)
建立單一使用者。
function createUser(options?: OperationOptions): Promise<CommunicationUserIdentifier>
參數
- options
- OperationOptions
要求的其他選項。
傳回
Promise<CommunicationUserIdentifier>
createUserAndToken(TokenScope[], CreateUserAndTokenOptions)
同時建立單一使用者和令牌。
function createUserAndToken(scopes: TokenScope[], options?: CreateUserAndTokenOptions): Promise<CommunicationUserToken>
參數
- scopes
要包含在令牌中的範圍。
- options
- CreateUserAndTokenOptions
要求的其他選項。
傳回
Promise<CommunicationUserToken>
deleteUser(CommunicationUserIdentifier, OperationOptions)
觸發使用者的撤銷事件,並刪除其所有數據。
function deleteUser(user: CommunicationUserIdentifier, options?: OperationOptions): Promise<void>
參數
正在刪除的使用者。
- options
- OperationOptions
要求的其他選項。
傳回
Promise<void>
getToken(CommunicationUserIdentifier, TokenScope[], GetTokenOptions)
建立限定範圍的使用者令牌。
function getToken(user: CommunicationUserIdentifier, scopes: TokenScope[], options?: GetTokenOptions): Promise<CommunicationAccessToken>
參數
要發行其令牌的使用者。
- scopes
要包含在令牌中的範圍。
- options
- GetTokenOptions
要求的其他選項。
傳回
Promise<CommunicationAccessToken>
getTokenForTeamsUser(GetTokenForTeamsUserOptions)
以相符的到期時間交換 Teams 使用者的 Azure AD 存取令牌,以取得新的通訊身分識別存取令牌。
function getTokenForTeamsUser(options: GetTokenForTeamsUserOptions): Promise<CommunicationAccessToken>
參數
- options
- GetTokenForTeamsUserOptions
用來交換 Teams 使用者的 Azure AD 存取令牌的選項,以取得新的通訊身分識別存取令牌。
傳回
Promise<CommunicationAccessToken>
revokeTokens(CommunicationUserIdentifier, OperationOptions)
撤銷為使用者建立的所有數據和令牌。
function revokeTokens(user: CommunicationUserIdentifier, options?: OperationOptions): Promise<void>
參數
要撤銷其令牌的使用者。
- options
- OperationOptions
要求的其他選項。
傳回
Promise<void>