Share via


LocalSecureStoreProvider.GetCredentials Method (String, Boolean)

Gets the credentials associated with the specified target application identifier and determines whether to prompt the user for credentials.

Namespace:  Microsoft.Office.BusinessData.Infrastructure.SecureStore
Assembly:  Microsoft.Office.BusinessData (in Microsoft.Office.BusinessData.dll)

Syntax

'Declaration
Public Function GetCredentials ( _
    appId As String, _
    alwaysShowUI As Boolean _
) As SecureStoreCredentialCollection
'Usage
Dim instance As LocalSecureStoreProvider
Dim appId As String
Dim alwaysShowUI As Boolean
Dim returnValue As SecureStoreCredentialCollection

returnValue = instance.GetCredentials(appId, _
    alwaysShowUI)
public SecureStoreCredentialCollection GetCredentials(
    string appId,
    bool alwaysShowUI
)

Parameters

  • alwaysShowUI
    Type: System.Boolean
    true to always prompt the user; false to prompt the user only if the credentials have not already been entered yet.

Return Value

Type: Microsoft.BusinessData.Infrastructure.SecureStore.SecureStoreCredentialCollection
The credential collection.

Implements

ILocalSecureStoreProvider.GetCredentials(String, Boolean)

Exceptions

Exception Condition
SecureStoreTargetApplicationNotFoundException

If a user clicks Cancel on the Windows Credentials Manager dialog that is displayed to enter credentials for a target application.

Remarks

If alwaysShowUI is set to false, this method prompts the user to enter the credentials if the credentials are not already set. So for the first usage, the user is prompted to enter the credentials and for subsequent calls the credentials are retrieved from the Windows credential store. If alwaysShowUI is set to true, this method displays the Windows credential dialog to get the credentials.

See Also

Reference

LocalSecureStoreProvider Class

LocalSecureStoreProvider Members

GetCredentials Overload

Microsoft.Office.BusinessData.Infrastructure.SecureStore Namespace