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 7068725
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:21:33+00:00 2026-05-28T05:21:33+00:00

I am using VS2005 C#. I have a Login control on my web form

  • 0

I am using VS2005 C#.

I have a Login control on my web form and I am able to log in with correct credentials:

I have no backend code which supports my Login control.

I am using Active Directory Authentication, and below is a code snippet of my AD in web.config:

<membership defaultProvider="MyADMembershipProvider">       
    <providers>
        <clear/>
            <add name="MyADMembershipProvider" type="System.Web.Security.ActiveDirectoryMembershipProvider, 
            System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" 
            applicationName="SOD" connectionStringName="ADConnectionString" 
            connectionUsername="BTDP\Jimmy" connectionPassword="p@ssww0rd"
            attributeMapUsername="sAMAccountName" enableSearchMethods="true" />
    </providers>
</membership>

I have declared a valid AD account above.

However, when a user of different credentials as the above logs in, the variable User.Identity.Name is identified as BTDP\Jimmy instead of the username of the logged in user, although the username and password the user entered went through AD authentication.

May I know if I am wrong for hard coding the credentials in the connection string?

How should I do it so that I am able to pump in the username and password into the connection string from the Login control in the web page?

  • 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-28T05:21:34+00:00Added an answer on May 28, 2026 at 5:21 am

    Not sure if this is something to do with either user impersonation or the fact that your application is querying the Domain Controller but impersonating as that user.
    The blog here might be helpful, has working example source you can try.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using VS2005 C#. I have a login page which uses a background
I am using VS2005 ASP.NET 2.0. I have a web application which uses Active
I have a Windows 7 machine on which I am using VS2005. .Net 2.0
I am writing code in VS2005 using its STL. I have one UI thread
I am using VS2005 C#, and I have an application which has a few
I am using VS2005 C#. I have a login box in my .aspx page,
I am using VS2005 C#. I have a .aspx login page and I would
I just starting using VS2005 and I wish to have code highlighting in C/C++.
I have a web application on VS2005 using C#. Whenever my webpage does not
I have a small website developed using VS2005 and mySQl, it's just 2 webforms

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.