ICredentialProvider interface

警告

现已弃用此 API。

Use ConfigurationBotFrameworkAuthentication instead to configure credentials. CredentialProvider interface. This interface allows Bots to provide their own implementation of what is, and what is not, a valid appId and password. This is useful in the case of multi-tenant bots, where the bot may need to call out to a service to determine if a particular appid/password pair is valid.

For Single Tenant bots (the vast majority) the simple static providers are sufficient.

方法

getAppPassword(string)

获取给定机器人 appId 的应用密码,如果它不是有效的 appId,则返回 Null 此方法是异步的,以便启用可能需要调用 serviced 来验证 appId/密码对的自定义实现。

isAuthenticationDisabled()

检查是否禁用了机器人身份验证。 如果禁用了机器人身份验证,则返回 true。 此方法是异步的,用于启用可能需要调用 serviced 以验证 appId/密码对的自定义实现。

isValidAppId(string)

验证 AppId。 此方法是异步的,用于启用可能需要调用 serviced 以验证 appId/密码对的自定义实现。

方法详细信息

getAppPassword(string)

获取给定机器人 appId 的应用密码,如果它不是有效的 appId,则返回 Null 此方法是异步的,以便启用可能需要调用 serviced 来验证 appId/密码对的自定义实现。

function getAppPassword(appId: string): Promise<string | null>

参数

appId

string

机器人 appid

返回

Promise<string | null>

密码或 null 表示无效的 appid

isAuthenticationDisabled()

检查是否禁用了机器人身份验证。 如果禁用了机器人身份验证,则返回 true。 此方法是异步的,用于启用可能需要调用 serviced 以验证 appId/密码对的自定义实现。

function isAuthenticationDisabled(): Promise<boolean>

返回

Promise<boolean>

如果禁用了机器人身份验证,则为 true。

isValidAppId(string)

验证 AppId。 此方法是异步的,用于启用可能需要调用 serviced 以验证 appId/密码对的自定义实现。

function isValidAppId(appId: string): Promise<boolean>

参数

appId

string

机器人 appid

返回

Promise<boolean>

如果它是有效的 AppId,则为 true