Assembly: ININ.IceLib (in ININ.IceLib.dll) Version: 0.0.0.0 (22.3.0.218)
Syntax
C# |
---|
public static class CommonCredentials |
Visual Basic |
---|
Public NotInheritable Class CommonCredentials |
Remarks
This allows an application to create a session without prompting for credentials each time by using credentials that were previously saved.
Examples
The following example illustrates one way to store credentials using
the CommonCredentials class.
... //Create a session and connect.
//Connected successfully. Store the credentials so they can be used to login later.
string applicationName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
StoredCredentials credentials = new StoredCredentials(applicationName, _Session, true);
CommonCredentials.SetCredentials(credentials, true); //save these credentials and set them as the default set.
...
This example demonstrates how to load the most recently stored credentials between the defaults
and those stored for this application.
...
string applicationName = System.Diagnostics.Process.GetCurrentProcess().ProcessName;
StoredCredentials credentials = CommonCredentials.GetCredentials(applicationName,
LoadFlags.Default | LoadFlags.Application,
LoadPreference.Newest);
if ((null != credentials) && credentials.HasPersistedPassword)
{
_session.Connect(credentials.SessionSettings,
credentials.HostSettings,
credentials.AuthSettings,
credentials.StationSettings);
}
else
{
PromptUserForLogin();
}
...
Examples
Project | Location |
---|---|
TutorialExample | LoginViewModel.cs, line 27, in LoginViewModel.#ctor |
Inheritance Hierarchy
ININ.IceLib.Connection..::..CommonCredentials
Version Information
For 4.0, supported for IC Server version 4.0 GA and beyond.
For 3.0, supported for IC Server version 3.0 GA and beyond.