47 lines
1.0 KiB
C#
47 lines
1.0 KiB
C#
|
using System;
|
||
|
using Novell.Casa.Client.Auth;
|
||
|
|
||
|
namespace TestClientAuth
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// Summary description for Class1.
|
||
|
/// </summary>
|
||
|
class Class1
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// The main entry point for the application.
|
||
|
/// </summary>
|
||
|
[STAThread]
|
||
|
static void Main(string[] args)
|
||
|
{
|
||
|
if (args.Length < 1)
|
||
|
{
|
||
|
Console.WriteLine("Usage: TestClientAuth [server]");
|
||
|
Console.WriteLine("Press enter to continue");
|
||
|
Console.ReadLine();
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
try
|
||
|
{
|
||
|
byte[] baToken = Authtoken.ObtainAuthToken("testService", args[0]);
|
||
|
Console.WriteLine("Token returned:");
|
||
|
for (int i=0; i<baToken.Length; i++)
|
||
|
{
|
||
|
Console.Write(baToken[i].ToString());
|
||
|
}
|
||
|
Console.WriteLine("");
|
||
|
Console.WriteLine("Press enter to continue");
|
||
|
Console.ReadLine();
|
||
|
}
|
||
|
catch (Exception e)
|
||
|
{
|
||
|
Console.WriteLine(e.ToString());
|
||
|
Console.WriteLine("");
|
||
|
Console.WriteLine("Press enter to continue");
|
||
|
Console.ReadLine();
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|