Share via


CredentialManager.GetCredentials(Uri, Boolean) Method

Definition

Retrieves the user credential with the given site URL.

public System.Net.ICredentials GetCredentials (Uri siteUrl, bool disallowDefaultCredentials = false);
member this.GetCredentials : Uri * bool -> System.Net.ICredentials
Public Function GetCredentials (siteUrl As Uri, Optional disallowDefaultCredentials As Boolean = false) As ICredentials

Parameters

siteUrl
Uri

The URL to the SharePoint site.

disallowDefaultCredentials
Boolean

Indicates if DefaultCredentials is allowed to return if user has not provided the credential for the given site URL during the session.

Returns

The user credentials.

Applies to