473,809 Members | 2,763 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Code based integrated authentication

Hi All!

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. Alsomost all the examples discussed in boxes 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.

I've got some code that will return the token from the AD network:

using System;
using System.Collecti ons.Generic;
using System.Text;
using System.Security .Permissions;
using System.Security .Principal;
using System.Threadin g;

namespace USPSD
{
class Program
{
static void Main(string[] args)
{

AppDomain.Curre ntDomain.SetPri ncipalPolicy(Pr incipalPolicy.W indowsPrincipal );
WindowsPrincipa l principal =
(WindowsPrincip al)Thread.Curre ntPrincipal;
WindowsIdentity identity = (WindowsIdentit y)principal.Ide ntity;
Console.WriteLi ne("Authenticat ed: " + identity.IsAuth enticated);
Console.WriteLi ne("Anonymous: " + identity.IsAnon ymous);
Console.WriteLi ne("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
Nov 8 '05 #1
0 1084

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
3611
by: See Sharp | last post by:
Hello all, I have a set of admin pages which are put in a subfolder called admin inside my application folder. I want to limit access to these admin pages. How can I do this? In Linux, I can password protect the directory, so that whenever a page within the admin subfolder is accessed for the first time, an authentication window pops up asking for username-password. How can I implement the same
4
8545
by: Ravikanth[MVP] | last post by:
Hi It is possible that IIS and SQL Server can reside on Seperate Machines and you can use Integrated Windows Authentication to connect. Ravikanth >-----Original Message-----
9
2513
by: Tom B | last post by:
In my web.config file I've specified Windows for the authentication, in IIS I've set it to Integrated Authentication. But my SQL connection is still showing Anonymous. Is there somewhere else I need to check? Thanks Win 2003, SQL Server 2000
4
2191
by: Chris Gatto | last post by:
Hi, I'm having what should be a minor problem but has turned into a 2 day slug fest with ASP.Net. I am simply attempting to authenticate my asp.net application users against users in an AD group set up on our domain. It seems to me I am missing something very simple and obvious, but none of the MSDN articles I have read are indicating what this might be. My setup is ASP.Net running on a Windows 2003/IIS 6 server. IIS security...
3
6124
by: Patrick.O.Ige | last post by:
Hi folks, How can i pass credentials to windows integrated authentication. I want to use my credentials from windows authentication and pass it on to different asp.net and asp pages without having to login again. Any help?
6
1705
by: Jéjé | last post by:
Hi, I have a custom aspx page which access RS (Reporting Services) using the webservice interface. I'm using the delegation (defautcredentialcache) to send the user authentication to RS. RS and my web application are on the same server. this works fine in 2 cases:
0
780
by: RTJudson | last post by:
Hi All! 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.
4
2299
by: santosh.tripathy | last post by:
We have a requirement where in a java based web application is getting integrated with the existing .net based web pages. The .net based web pages are secured through forms authentication. Is there any mechanism where we can extend the same form based authentication to java based web pages?
11
5397
by: benoitc | last post by:
I've been having a problem debugging an ASP.NET 1.1 application on an existing Windows XP/Visual Studio 2003 workstation that I've inherited from somebody else. The application builds fine, but when I try to debug, it gives me the message: Error When Trying to Run Project: Unable to Start Debugging on the Web Server. Debugging failed because integrated Windows authentication is not enabled. Now, the obvious solution for this of course...
0
9721
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9601
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10378
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10115
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.