VpnChannel.RequestCredentials 方法

定義

要求 VPN 平台從使用者收集認證。 外掛程式可以指定要收集的認證類型和形式。 結果是物件,其中包含主要認證,視變更和到期案例的類型和次要認證而定。

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

可選擇性傳遞的憑證,以指出平臺其使用意圖,並取得同意並解除鎖定其保護。

傳回

物件,其中包含使用者所填入的主要認證和任何其他過渡認證。

Windows 需求

應用程式功能
networkingVpnProvider

備註

如果函式成功,傳回值會 S_OK,否則函式會傳回描述特定失敗的錯誤 HRESULT 值。 如果外掛程式未連線,錯誤會 E_ACCESSDENIED。 如果沒有可用的記憶體,錯誤會 E_OUTOFMEMORY

注意

線上 VPN 外掛程式外部對此 API 的任何呼叫都會失敗,因為 VPN 外掛程式與系統之間的活動和互動是由 VPN 設定檔所控制。

適用於