Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 893501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T14:13:58+00:00 2026-05-15T14:13:58+00:00

Is it possible to Impersonate a user when using Forms Authentication? The thing is

  • 0

Is it possible to Impersonate a user when using Forms Authentication?

The thing is that I want an external login for users and an internal site that just uses integrated windows security and the users need to be impersonated.

I’ve looked around and found that John’s answer here is really good, but I don’t quite get how I can mix it up with my Forms authentication.

Suggestions?


Edit

I want to have an <asp:Login /> control and this control will authenticate against an Active Directory which has the same set of users as the Windows Machine that I want to use impersonation on.

My problem is that I don’t get how I can impersoante with the same username and pasword that is provided to the <asp:Login /> control.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T14:13:59+00:00Added an answer on May 15, 2026 at 2:13 pm

    In order for that solution to work, you’ll need access to the user’s id and password. I don’t believe that you can get this using the Login user control; you’ll need to create your own login form and handle the login actions yourself. Keep the user’s id and password, preferably in a secure string, in the session once you’ve authenticated and when you need to access the internal site on their behalf, use the Impersonator class from the referenced example to impersonate them using the credentials.

      using (var context = Impersonator.LogOn( username, password ))
      {
          try
          {
          ....
          }
          finally
          {
             context.Undo();
          }
      }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 541k
  • Answers 541k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer It looks like @vote hasn't been initialized. Add the following… May 17, 2026 at 2:58 am
  • Editorial Team
    Editorial Team added an answer The only way I found was this: call 'operator<<(std::ostream&, myclass&)'(mycout,… May 17, 2026 at 2:58 am
  • Editorial Team
    Editorial Team added an answer You are setting the extra with an array. You are… May 17, 2026 at 2:58 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have two Active Directory domains, A and B. Users in domain A need
I am familiar with impersonating an account in .net by using: dim myIdentity as
Short version : Is it possible or not to use impersonation in ASP.NET to
I am using DirectoryServices and the WinNT:// provider to connect to a remote computer.
I modified the ASP.NET login control to also allow specifying UserRole ('Employee' or 'Volunteer').
Possible Duplicate: Should I learn C before learning C++? As a professional (Java) programmer
Possible Duplicate: How do you give a C# Auto-Property a default value? Hi all:
Possible Duplicate: How to detect if JavaScript is disabled? I have a website which
Possible Duplicate: How to copy part of an array to another array in C#
Possible Duplicate: Difference between Convert.tostring() and .tostring() Hi Carrying on from this question What

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.