VpnChannel.RequestCredentials 方法

定义

请求 VPN 平台从用户那里收集凭据。 插件可以指定要收集的凭据的类型和形式。 结果是一个对象,其中包含main凭据,具体取决于更改和过期情况的类型和辅助凭据。

public:
 virtual VpnPickedCredential ^ RequestCredentials(VpnCredentialType credType, bool isRetry, bool isSingleSignOnCredential, Certificate ^ certificate) = RequestCredentials;
VpnPickedCredential RequestCredentials(VpnCredentialType const& credType, bool const& isRetry, bool const& isSingleSignOnCredential, Certificate const& certificate);
public VpnPickedCredential RequestCredentials(VpnCredentialType credType, bool isRetry, bool isSingleSignOnCredential, Certificate certificate);
function requestCredentials(credType, isRetry, isSingleSignOnCredential, certificate)
Public Function RequestCredentials (credType As VpnCredentialType, isRetry As Boolean, isSingleSignOnCredential As Boolean, certificate As Certificate) As VpnPickedCredential

参数

credType
VpnCredentialType

一个枚举值,指示要收集的凭据类型。

isRetry
Boolean

bool

如果请求是前一次失败尝试的重试,则为 TRUE;否则为 FALSE。

isSingleSignOnCredential
Boolean

bool

如果凭据应由通过 VPN 隧道运行并对 VPN 上的资源进行身份验证的所有应用程序使用,则为 TRUE;否则为 FALSE。 这通过 VPN 提供单一登录体验。

certificate
Certificate

可选择传递以指示平台使用意向并获取同意并解锁其保护的证书。

返回

一个 对象,其中包含main凭据以及用户填充的任何其他过渡凭据。

Windows 要求

应用功能
networkingVpnProvider

注解

如果函数成功,则返回值 S_OK,否则函数将返回描述特定故障的错误 HRESULT 值。 如果插件未连接,则 E_ACCESSDENIED错误。 如果没有更多可用内存,则 E_OUTOFMEMORY错误。

注意

在连接的 VPN 插件外部调用此 API 将失败,因为 VPN 插件与系统之间的活动和交互由 VPN 配置文件控制。

适用于