Commit 7ada437e authored by Marvin S. Addison's avatar Marvin S. Addison
Browse files

Add support for switching among dev/pprd/prod environments on command line.


git-svn-id: https://svn.middleware.vt.edu/svn/ed/edsamples@10086 fa4a4108-76f2-0310-9f0d-ba9fffaf4ff6
parent 1bfef3a2
......@@ -13,13 +13,27 @@ namespace EdAuthTest
{
if (args.Length < 1)
{
Console.WriteLine("USAGE: EdAuthTest uupid");
Console.WriteLine("USAGE: EdAuthTest uupid [dev|pprd|prod]");
return;
}
string uupid = args[0];
string password = GetPassword(string.Format("Password for {0}:", uupid));
string ldapHost = EdConstants.ED_AUTH;
int ldapPort = 389;
if (args.Length > 1)
{
switch (args[1])
{
case "dev":
ldapPort = EdConstants.ALT_PORT;
ldapHost = EdConstants.ED_DEV;
break;
case "pprd":
ldapPort = EdConstants.ALT_PORT;
ldapHost = EdConstants.ED_PPRD;
break;
}
}
string ldapFilter = "uupid=" + uupid;
Console.WriteLine(string.Format("Attempting to authenticate to {0} as {1}", ldapHost, uupid));
......@@ -40,7 +54,7 @@ namespace EdAuthTest
new EdCertificateVerifier(ldapHost).VerifyCertificate);
// A QueryClientCertificateCallback is required based on our testing.
// We can only imagine that this handler is required when the SSL handshake
// Investigation suggests that this handler is required when the SSL handshake
// contains a client certificate request directive.
conn.SessionOptions.QueryClientCertificate =
delegate(LdapConnection c, byte[][] trustedCAs)
......
......@@ -12,7 +12,7 @@ namespace EdIdTest
{
if (args.Length < 2)
{
Console.WriteLine("USAGE: EdIdTest uusid query");
Console.WriteLine("USAGE: EdIdTest uusid query [dev|pprd|prod]");
return;
}
// The following should be the uusid of your ED-ID service
......@@ -20,6 +20,20 @@ namespace EdIdTest
string ldapQuery = args[1];
string ldapHost = EdConstants.ED_ID;
int ldapPort = 389;
if (args.Length > 2)
{
switch (args[2])
{
case "dev":
ldapPort = EdConstants.ALT_PORT;
ldapHost = EdConstants.ED_DEV;
break;
case "pprd":
ldapPort = EdConstants.ALT_PORT;
ldapHost = EdConstants.ED_PPRD;
break;
}
}
Console.WriteLine(string.Format("Querying {0} as service {1} for {2}", ldapHost, certCN, ldapQuery));
......
......@@ -12,13 +12,27 @@ namespace EdLiteTest
{
if (args.Length < 2)
{
Console.WriteLine("USAGE: EdLiteTest query attributeList");
Console.WriteLine("USAGE: EdLiteTest query attributeList [dev|pprd|prod]");
return;
}
string ldapQuery = args[0];
string[] attributes = args[1].Split(',');
string ldapHost = EdConstants.ED_LITE;
int ldapPort = 389;
if (args.Length > 2)
{
switch (args[2])
{
case "dev":
ldapPort = EdConstants.ALT_PORT;
ldapHost = EdConstants.ED_DEV;
break;
case "pprd":
ldapPort = EdConstants.ALT_PORT;
ldapHost = EdConstants.ED_PPRD;
break;
}
}
Console.WriteLine(string.Format("Querying {0} for {1}", ldapHost, ldapQuery));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment