Rebornbuddy
Loading...
Searching...
No Matches
AdysTech.CredentialManager.CredentialManager Class Reference

Static Public Member Functions

static NetworkCredential PromptForCredentials (string target, ref bool save, IntPtr parentWindowHandle=default)
 Opens OS Version specific Window prompting for credentials.
static NetworkCredential PromptForCredentials (string target, ref bool save, string message, string caption, IntPtr parentWindowHandle=default)
 Opens OS Version specific Window prompting for credentials.
static NetworkCredential PromptForCredentials (string target, ref bool save, string message, string caption, string defaultUserName, IntPtr parentWindowHandle=default)
 Opens OS Version specific Window prompting for credentials.
static NetworkCredential PromptForCredentialsConsole (string target)
 Accepts credentials in a console window.
static ICredential SaveCredentials (string target, NetworkCredential credential, CredentialType type=CredentialType.Generic, bool AllowNullPassword=false)
 Saves the given Network Credential into Windows Credential store.
static ? NetworkCredential GetCredentials (string target, CredentialType type=CredentialType.Generic)
 Extract the stored credential from Windows Credential store.
static ? Dictionary< string, NetworkCredential > EnumerateCredentials (string? target=null)
 Enumerate the specified stored credentials in the Windows Credential store.
static List< ICredentialEnumerateICredentials (string target=null)
 Enumerate the specified stored credentials in the Windows Credential store.
static bool RemoveCredentials (string target, CredentialType type=CredentialType.Generic)
 Remove stored credentials from windows credential store.
static string GetBasicAuthString (this NetworkCredential cred)
 Generates a string that can be used for "Auth" headers in web requests, "username:password" encoded in Base64.
static ICredential GetICredential (string target, CredentialType type=CredentialType.Generic)
 Extract the stored credential from Windows Credential store.

Member Function Documentation

◆ EnumerateCredentials()

? Dictionary< string, NetworkCredential > AdysTech.CredentialManager.CredentialManager.EnumerateCredentials ( string? target = null)
static

Enumerate the specified stored credentials in the Windows Credential store.

Parameters
targetName of the application or URL for which the credential is used
Returns
Return a List<NetworkCredential> if success, null if target not found, throw if failed to read stored credentials

◆ EnumerateICredentials()

List< ICredential > AdysTech.CredentialManager.CredentialManager.EnumerateICredentials ( string target = null)
static

Enumerate the specified stored credentials in the Windows Credential store.

Parameters
targetName of the application or URL for which the credential is used
Returns
Return a List<ICredential> if success, null if target not found, throw if failed to read stored credentials

◆ GetBasicAuthString()

string AdysTech.CredentialManager.CredentialManager.GetBasicAuthString ( this NetworkCredential cred)
static

Generates a string that can be used for "Auth" headers in web requests, "username:password" encoded in Base64.

Parameters
cred
Returns

◆ GetCredentials()

? NetworkCredential AdysTech.CredentialManager.CredentialManager.GetCredentials ( string target,
CredentialType type = CredentialType::Generic )
static

Extract the stored credential from Windows Credential store.

Parameters
targetName of the application/Url where the credential is used for
typeCredential type
Returns
return the credentials if success, null if target not found, throw if failed to read stored credentials

◆ GetICredential()

ICredential AdysTech.CredentialManager.CredentialManager.GetICredential ( string target,
CredentialType type = CredentialType::Generic )
static

Extract the stored credential from Windows Credential store.

Parameters
targetName of the application/Url where the credential is used for
typeCredential type
Returns
return the ICredential if success, null if target not found, throw if failed to read stored credentials

◆ PromptForCredentials() [1/3]

NetworkCredential AdysTech.CredentialManager.CredentialManager.PromptForCredentials ( string target,
ref bool save,
IntPtr parentWindowHandle = default )
static

Opens OS Version specific Window prompting for credentials.

Parameters
targetA descriptive text for where teh credentials being asked are used for
saveWhether or not to offer the checkbox to save the credentials
Returns
NetworkCredential object containing the user name,

◆ PromptForCredentials() [2/3]

NetworkCredential AdysTech.CredentialManager.CredentialManager.PromptForCredentials ( string target,
ref bool save,
string message,
string caption,
IntPtr parentWindowHandle = default )
static

Opens OS Version specific Window prompting for credentials.

Parameters
targetA descriptive text for where teh credentials being asked are used for
saveWhether or not to offer the checkbox to save the credentials
messageA brief message to display in the dialog box
captionTitle for the dialog box
Returns
NetworkCredential object containing the user name,

◆ PromptForCredentials() [3/3]

NetworkCredential AdysTech.CredentialManager.CredentialManager.PromptForCredentials ( string target,
ref bool save,
string message,
string caption,
string defaultUserName,
IntPtr parentWindowHandle = default )
static

Opens OS Version specific Window prompting for credentials.

Parameters
targetA descriptive text for where teh credentials being asked are used for
saveWhether or not to offer the checkbox to save the credentials
messageA brief message to display in the dialog box
captionTitle for the dialog box
defaultUserNameDefault value for username
Returns
NetworkCredential object containing the user name,

◆ PromptForCredentialsConsole()

NetworkCredential AdysTech.CredentialManager.CredentialManager.PromptForCredentialsConsole ( string target)
static

Accepts credentials in a console window.

Parameters
targetA descriptive text for where teh credentials being asked are used for
Returns
NetworkCredential object containing the user name,

◆ RemoveCredentials()

bool AdysTech.CredentialManager.CredentialManager.RemoveCredentials ( string target,
CredentialType type = CredentialType::Generic )
static

Remove stored credentials from windows credential store.

Parameters
targetName of the application/Url where the credential is used for
Returns
True: Success, throw if failed

◆ SaveCredentials()

ICredential AdysTech.CredentialManager.CredentialManager.SaveCredentials ( string target,
NetworkCredential credential,
CredentialType type = CredentialType::Generic,
bool AllowNullPassword = false )
static

Saves the given Network Credential into Windows Credential store.

Parameters
targetName of the application/Url where the credential is used for
credentialCredential to store
typeCredential type
Returns
True:Success, throw if failed