Rename Credential.Name to PrincipleName. PrincipleName comes from the security service provider, which may not correspond to the domain user name. For instance, if I'm using kerberos on my domain, my principle may be user@DIVISION.CORP.COM, meanwhile my username might be CORP\user.
This commit is contained in:
@@ -72,7 +72,7 @@ namespace NSspi.Credentials
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Returns the name of the principle of the credential.
|
/// Returns the name of the principle of the credential.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string Name
|
public string PrincipleName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -33,11 +33,11 @@ namespace NSspi
|
|||||||
clientCred = new ClientCredential( packageName );
|
clientCred = new ClientCredential( packageName );
|
||||||
serverCred = new ServerCredential( packageName );
|
serverCred = new ServerCredential( packageName );
|
||||||
|
|
||||||
Console.Out.WriteLine( clientCred.Name );
|
Console.Out.WriteLine( clientCred.PrincipleName );
|
||||||
|
|
||||||
client = new ClientContext(
|
client = new ClientContext(
|
||||||
clientCred,
|
clientCred,
|
||||||
serverCred.Name,
|
serverCred.PrincipleName,
|
||||||
ContextAttrib.MutualAuth |
|
ContextAttrib.MutualAuth |
|
||||||
ContextAttrib.InitIdentify |
|
ContextAttrib.InitIdentify |
|
||||||
ContextAttrib.Confidentiality |
|
ContextAttrib.Confidentiality |
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace TestClient
|
|||||||
this.connection.Disconnected += connection_Disconnected;
|
this.connection.Disconnected += connection_Disconnected;
|
||||||
|
|
||||||
// --- UI Fillout ---
|
// --- UI Fillout ---
|
||||||
this.usernameTextbox.Text = this.cred.Name;
|
this.usernameTextbox.Text = this.cred.PrincipleName;
|
||||||
|
|
||||||
UpdateButtons();
|
UpdateButtons();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ namespace TestServer
|
|||||||
|
|
||||||
UpdateButtons();
|
UpdateButtons();
|
||||||
|
|
||||||
this.serverUsernameTextbox.Text = this.serverCred.Name;
|
this.serverUsernameTextbox.Text = this.serverCred.PrincipleName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Form1_FormClosing( object sender, FormClosingEventArgs e )
|
private void Form1_FormClosing( object sender, FormClosingEventArgs e )
|
||||||
|
|||||||
Reference in New Issue
Block a user