Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Code based Integrated Windows Authentication

Reply
Thread Tools

Code based Integrated Windows Authentication

 
 
RTJudson
Guest
Posts: n/a
 
      11-08-2005
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(Princip alPolicy.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
 
Reply With Quote
 
 
 
 
RTJudson
Guest
Posts: n/a
 
      11-08-2005
Ok. After a little more research it appears I need to use some code out of
the System.Web.Security namespace to pass my credientials over the network.
Is my assumption correct?

"RTJudson" wrote:

> 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(Princip alPolicy.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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java - Integrated Windows Authentication - NTLM Authentication Forwarding Will Java 5 12-03-2005 01:00 AM
SQL integrated authentication when using forms authentication Brett Smith ASP .Net 2 10-26-2004 02:15 PM
Integrated Windows Authentication ruca ASP .Net 1 07-16-2004 09:41 AM
Intranet and Integrated Windows Authentication Andrew ASP .Net 4 06-22-2004 11:22 PM
Basic Authentication v. Integrated Windows Authentication w/ Delegation Mark ASP .Net 0 01-20-2004 03:13 PM



Advertisments