Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2005

Tip: Looking for answers? Try searching our database.

Code based Integrated Windows Authentication

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
RTJudson - 08 Nov 2005 10:56 GMT
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
RTJudson - 08 Nov 2005 14:58 GMT
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?

> Hi All!
>
[quoted text clipped - 51 lines]
> Thanks in Advance!
> --Richard

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.