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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:55:39+00:00 2026-05-14T03:55:39+00:00

I am working in a Login page and teh logic is like -> try

  • 0

I am working in a Login page and teh logic is like ->

try 
{
    DirectoryEntry LDAPLogin = new DirectoryEntry(ConfigurationSettings.AppSettings ["LDAPPath"].ToString(), Usuario, Txt_Contrasenia.Text.ToString());

    if (LDAPLogin.NativeGuid != LDAPLogin.Name)
       ValidarGrupo();
}
catch (Exception exc)
{
   Label_Info.Text = "Sus credenciales no son validas: " + Usuario.ToString() + " " + exc.Message;
}

If the user enters the rights credentials I call a method ValidarGrupo that implements a lookup in the AD for a group of the user

I would like to replace the username and password with UseDefaultCredentials in order to avoid that the user has to enter the username and password and the Login pages use the credentials of the user that is login on the machine.

  • 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-14T03:55:40+00:00Added an answer on May 14, 2026 at 3:55 am

    I would like to replace the username
    and password with
    UseDefaultCredentials in order to
    avoid that the user has to enter the
    username and password and the Login
    pages use the credentials of the user
    that is login on the machine.

    So you basically want to check whether the currently logged in user is valid?

    I believe you can just simply create the DirectoryEntry without specifying any username/password – in that case, System.DirectoryServices will automatically use the current user credentials:

    string ldapPath = ConfigurationSettings.AppSettings ["LDAPPath"];
    DirectoryEntry LDAPLogin = new DirectoryEntry(ldapPath);
    

    That should be enough, I believe!

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

Sidebar

Related Questions

i'm working on a custom login page in mvc.net. I check logins like so:
I'm working on a login page for my website and I want to bold
I'm working on a login page, I want the user to see his name
I am using Asp.Net/C# .Currently I am working on the Login page,My login page
I am working on a single sign-on login page using Shibboleth that will be
My registration page and login form is working fine. If any member register and
I'm new to web development. Right now I'm working on a login feature on
I've created an almost full working login system, but my registration page doesn't work
Trying to get a login script working, I kept getting the same login page
I am struggling to get my LogIn/Registering system working. I have a register.aspx page

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.