Using Forms Authentication to pass credentials to Windows authentication

Last post 01-19-2007 5:23 AM by Leijun Jie - MSFT. 5 replies.

Sort Posts:

  • Using Forms Authentication to pass credentials to Windows authentication

    01-11-2007, 5:41 PM
    • Loading...
    • jonefer
    • Joined on 01-11-2007, 10:13 PM
    • Posts 27

    I know this question has been asked a lot.  But I have just 2 specific requests:

    1) All I need is a way to pass the credentials that are manually entered in a custom form to Windows authentication
    2) Can the example - please - be in Visual Basic?

    Specific way I want to use forms authentication:
    I have an application that is run on an intranet.  This application is restricted to a list of users contained in a database.

    I don't want to store any of the user's passwords - so I have been successful using Windows Authentication and only check for their UserID.

    Lately, some machines have been added - called Shared Utility Workstations, (SUW) they don't require a user to manually login.
    The problem with these machines is that they make the numerous users who will use my application - anonymous - to my tracking.

    To correct this, all that would need to be done is to put a custom login page that passes the users -manually entered- credentials to Windows authentication.

    I have already written the code to present a Custom Login page when SUW machine is recognized.
    So all I need now is the method to pass credentials to Windows authentication from that custom login page.

     

     

     

     

     

  • Re: Using Forms Authentication to pass credentials to Windows authentication

    01-11-2007, 6:38 PM
    Answer
    Darrell Norton, MVP
    Darrell Norton's Blog


    Please mark this post as answered if it helped you!
  • Re: Using Forms Authentication to pass credentials to Windows authentication

    01-12-2007, 5:55 PM
    • Loading...
    • jonefer
    • Joined on 01-11-2007, 10:13 PM
    • Posts 27

    I checked that example - it's in C#   - 

    I know I speak for at least a few,  so I'll have to again request.  Please help me convert that to Visual Basic?

     

  • Re: Using Forms Authentication to pass credentials to Windows authentication

    01-15-2007, 4:49 AM
    Answer

    Try this convertor:

    http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx

    Maybe the C# code can not be translated into exactly correct VB code, anyways that should show you what the code does.

    The future is now...
    Sincerely,
    LeiJun Jie
    Microsoft Online Community Support
  • Re: Using Forms Authentication to pass credentials to Windows authentication

    01-17-2007, 8:48 PM
    Answer
    • Loading...
    • jonefer
    • Joined on 01-11-2007, 10:13 PM
    • Posts 27

    Thank you.  That was helpful. 

    If anyone else needs the same solution as described in my original post, I modified the solution: ASP.NET Forms Authentication, Part 2.

    http://www.ondotnet.com/pub/a/dotnet/2003/01/20/formsauthp2.html

    What I didn't realize is that the solution will work ALSO if authenticaion mode is set to "WINDOWS".
    So I didn't need to pass any of my own 401 - yada yada yada...

    I kept my current Windows authentication that automatically checks for users in my database.
    If the user's ID isn't found, I send them to the Login.aspx solution described above.  When the user enters correct credentials it sends them to the default.aspx  - which you can write your own logic to override the automatic Windows authentication and take the user to the main page.

    All I needed was some clean VB which the convertor provided for me. 

    If you or anyone would like more details, I'd be happy to provide them - just post your request here.

  • Re: Using Forms Authentication to pass credentials to Windows authentication

    01-19-2007, 5:23 AM
    Hi jonefer, I'm glad to see you've got the issue resolved, and really thanks very much for kindly sharing your solutio with us!

    Cheers,
    The future is now...
    Sincerely,
    LeiJun Jie
    Microsoft Online Community Support
Page 1 of 1 (6 items)
Microsoft Communities
Page view counter