how to modify this code ?

  •  

    I have successfully implemented the forms authentication method to my report server using  MSDN web site http://msdn2.microsoft.com/en-us/library/ms160724.aspx

    bellow is the code when user clicks on a Logon button from the logon.aspx web page.

    private void ServerBtnLogon_Click(object sender,

    System.EventArgs e)

    {

    bool passwordVerified = false;

    try

    {

    passwordVerified =

    AuthenticationUtilities.VerifyPassword(TxtUser.Text,TxtPwd.Text);

    if (passwordVerified)

    {

    FormsAuthentication.RedirectFromLoginPage(

    TxtUser.Text,

    false);

    }

    else

    {

    Response.Redirect("logon.aspx");

    }

    }

    catch(Exception ex)

    {

    lblMessage.Text = ex.Message;

    return;

    }

    if (passwordVerified == true )

    {

    // The user is authenticated

    // At this point, an authentication ticket is normally created

    // This can subsequently be used to generate a GenericPrincipal

    // object for .NET authorization purposes

    // For details, see "How To: Use Forms authentication with

    // GenericPrincipal objects

    lblMessage.Text = "Logon successful: User is authenticated";

    }

    else

    {

    lblMessage.Text = "Invalid username or password";

    }

    }

    }

    ===============

    Also now i want add Extra functionality to the existing code, like i want to check if the perticular login user is existing in the active directory ?(Authenticating against the  active directory users)

    please help me to modify my code?

     regards

    sujithf

  • did you review this articule: http://support.microsoft.com/kb/326340

  • Hi Newbie,

    Many thanks to your post, i will try this and update you as soon.

    best regards

    sujithf

  • Hi newbiew,

    i have checked that your article,but in that article i have to code user password,problem is i dont know the password and now i have a different scenario like this

    I have a web form which will allow user to enter thier Domain name and Thier username.

    Now problem is how do i check that user name is exist in that perticular domain name active directory ?

    Help me to sort out this problem,i refered several articles from the web but every articles disscussed by giving username and password (Both) and check against the active directory?

    but in my case i have got only Domain name and Username only,domain name and user name is changing depending on the user input

    and also i need to do this using asp.net 1.1 and  and 2.0

     

    any idea ?

     

    regards

    sujthf

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply