Click here to Skip to main content
15,902,636 members
Home / Discussions / C#
   

C#

 
GeneralCOM Object Pin
FlamTaps9-Jul-04 7:25
FlamTaps9-Jul-04 7:25 
GeneralRe: COM Object Pin
MilesAhead9-Jul-04 8:17
MilesAhead9-Jul-04 8:17 
GeneralRe: COM Object Pin
FlamTaps12-Jul-04 8:55
FlamTaps12-Jul-04 8:55 
GeneralRe: COM Object Pin
Anonymous12-Jul-04 9:37
Anonymous12-Jul-04 9:37 
GeneralRe: COM Object Pin
FlamTaps12-Jul-04 10:29
FlamTaps12-Jul-04 10:29 
GeneralRe: COM Object Pin
MilesAhead14-Jul-04 14:07
MilesAhead14-Jul-04 14:07 
GeneralImpersonation in C# question, please help! Pin
garfieldlee999-Jul-04 7:00
garfieldlee999-Jul-04 7:00 
GeneralRe: Impersonation in C# question, please help! Pin
Heath Stewart9-Jul-04 9:04
protectorHeath Stewart9-Jul-04 9:04 
First of all, this question should be posted in the ASP.NET forum, but I'll answer anyway.

Instead of manually impersonating a user by handling the authentication yourself, ASP.NET already has this functionality built-in. By simply adding <identity impersonate="true" /> under the <system.web> configuration section in your Web.config file, you're half-way there. If this is for an intranet, IE will automatically use their domain credentials. You can force NTLM authentication (all handled for you by ASP.NET) by adding <authentication mode="Windows" /> under the same section I mentioned above. Done. Now IE will securely prompt for credentials if the user was not authenticated and will authenticate against the domain.

With your approach, you'd have to prompt for credentials in a web page. If you don't use an SSL certificate to encrypt the transfer, you've made a gaping hole in security because a simple packet sniffer could sniff domain usernames and passwords.

If you want to know how to impersonateusers anyway, lookup WindowsIdentity.Impersonate in the .NET Framework SDK. It provides a thorough example.

 

Microsoft MVP, Visual C#
My Articles
GeneralProperty Grid Pin
machocr9-Jul-04 6:53
machocr9-Jul-04 6:53 
GeneralRe: Property Grid Pin
Heath Stewart9-Jul-04 9:07
protectorHeath Stewart9-Jul-04 9:07 
GeneralRe: Property Grid Pin
Jay Shankar11-Jul-04 22:26
Jay Shankar11-Jul-04 22:26 
General.NET 2.0's WebBrowser control Pin
Judah Gabriel Himango9-Jul-04 6:32
sponsorJudah Gabriel Himango9-Jul-04 6:32 
GeneralRe: .NET 2.0's WebBrowser control Pin
Heath Stewart9-Jul-04 9:11
protectorHeath Stewart9-Jul-04 9:11 
Generalimplement a own shell-view Pin
Shir Khan9-Jul-04 5:23
Shir Khan9-Jul-04 5:23 
GeneralRe: implement a own shell-view Pin
Jesse Squire9-Jul-04 5:36
Jesse Squire9-Jul-04 5:36 
GeneralRe: implement a own shell-view Pin
Nick Parker9-Jul-04 6:00
protectorNick Parker9-Jul-04 6:00 
GeneralData layer DLL .Config Pin
Andy H9-Jul-04 4:58
Andy H9-Jul-04 4:58 
GeneralRe: Data layer DLL .Config Pin
Heath Stewart9-Jul-04 9:16
protectorHeath Stewart9-Jul-04 9:16 
GeneralFind on Page with IE browser control Pin
weekly_s9-Jul-04 4:47
weekly_s9-Jul-04 4:47 
GeneralRe: Find on Page with IE browser control Pin
Heath Stewart9-Jul-04 6:18
protectorHeath Stewart9-Jul-04 6:18 
GeneralRe: Find on Page with IE browser control Pin
weekly_s9-Jul-04 7:55
weekly_s9-Jul-04 7:55 
GeneralRe: Find on Page with IE browser control Pin
Heath Stewart9-Jul-04 8:54
protectorHeath Stewart9-Jul-04 8:54 
GeneralLimiting the bandwidth Pin
pi_trek9-Jul-04 1:09
pi_trek9-Jul-04 1:09 
GeneralRe: Limiting the bandwidth Pin
Dave Kreskowiak9-Jul-04 6:07
mveDave Kreskowiak9-Jul-04 6:07 
GeneralRe: Limiting the bandwidth Pin
pi_trek10-Jul-04 3:54
pi_trek10-Jul-04 3:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.