R
RTJudson
Hi All!
Windows 2003
IIS6
Forgive a newbie. I am new to C#, mostly worked with perl (please, no gasps
of horror or derision!).
I have to applications that I need to integrate. One is a IIS6 based
WebServices app, the other, well, not. I was going to build an interface
between the two. I have the, call it App A -> App B part working fine. App B
being the non-webservices app.
App B -> App A requires Windows Integrated authentication. Not forms based
or basic or digest. Almost all the examples discussed in books etc all
discuss forms based.
I'd like to do two things: 1) pass user/pwd info to the web services app
and/or 2) pass currently logged in user info to the web services app using a
..net command line program.
I've got some code that will return the token from the AD network:
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Permissions;
using System.Security.Principal;
using System.Threading;
namespace USPSD
{
class Program
{
static void Main(string[] args)
{
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
WindowsPrincipal principal =
(WindowsPrincipal)Thread.CurrentPrincipal;
WindowsIdentity identity = (WindowsIdentity)principal.Identity;
Console.WriteLine("Authenticated: " + identity.IsAuthenticated);
Console.WriteLine("Anonymous: " + identity.IsAnonymous);
Console.WriteLine("Token: " + identity.Token);
}
}
}
Does anyone have a code snippet to share that discusses how to do
authentication with a console app?
I'm using C# 2005 Express Edition by the way.
Thanks in Advance!
--Richard
Windows 2003
IIS6
Forgive a newbie. I am new to C#, mostly worked with perl (please, no gasps
of horror or derision!).
I have to applications that I need to integrate. One is a IIS6 based
WebServices app, the other, well, not. I was going to build an interface
between the two. I have the, call it App A -> App B part working fine. App B
being the non-webservices app.
App B -> App A requires Windows Integrated authentication. Not forms based
or basic or digest. Almost all the examples discussed in books etc all
discuss forms based.
I'd like to do two things: 1) pass user/pwd info to the web services app
and/or 2) pass currently logged in user info to the web services app using a
..net command line program.
I've got some code that will return the token from the AD network:
using System;
using System.Collections.Generic;
using System.Text;
using System.Security.Permissions;
using System.Security.Principal;
using System.Threading;
namespace USPSD
{
class Program
{
static void Main(string[] args)
{
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal);
WindowsPrincipal principal =
(WindowsPrincipal)Thread.CurrentPrincipal;
WindowsIdentity identity = (WindowsIdentity)principal.Identity;
Console.WriteLine("Authenticated: " + identity.IsAuthenticated);
Console.WriteLine("Anonymous: " + identity.IsAnonymous);
Console.WriteLine("Token: " + identity.Token);
}
}
}
Does anyone have a code snippet to share that discusses how to do
authentication with a console app?
I'm using C# 2005 Express Edition by the way.
Thanks in Advance!
--Richard