Forms based Windows Authentication

Currently i use windows authentication.  When a user goes to the site a popup box comes up asking for username and password.  Is there an wasy way to make this a form on a page instead?

I am currently using Visual Studio 2008 Express.
I am using VB
LVL 6
phoenixfire425Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tristan ShortlandCommented:
Create a page with a form which verifies some user credentials supplied by the user (there are prebuilt controls for this which will integrate with a users database very well built by MicroSoft, or you can build your own - textbox for username, one for password and a button is all it takes...).

*Then in web.config change authentication mode to forms where it currently says windows.*

You can use the ASP.NET configuration tool (Website -> ASP.NET Configuration) to manage users and roles, if you choose to use the Microsoft framework.

There's lot's of good info on google too...

Tristan
0
phoenixfire425Author Commented:
When i try to use the control built into VS.net it does not find the user names from my active directory.

and if i create a form i am not sure how to pass the names and passwords to be authenticated.
0
Tristan ShortlandCommented:
When using forms authentication you aren't looking at active directory. Using the built in controls will point to a database of usernames/passwords/role information for users.

If you want to integrate with active directory then you will have to use Windows authentication.

You may be able to do something clever in the aplication to get the Windows username and password for that user then validate those against ones they have entered into a web form built by you...
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

phoenixfire425Author Commented:
That what i want to do.
Is have a form. but not form authentication.
The username and password are used from active directory.
So i guess it would be a kind of Mixed mode form?
any idea on how to do this?
0
Tristan ShortlandCommented:
0
phoenixfire425Author Commented:
Or ideally I would like to use windows authentication with a Form Based Logon Screen  
0
phoenixfire425Author Commented:
Thats in C# i need the VB type :(
0
Tristan ShortlandCommented:
You'll find that a lot with code examples on the net.
All .NET languages share the same framework so the differences are only syntactical.
Here is an example:

if(!Page.IsPostback())
{
    string domainUser = System.Security.Principal.WindowsIdentity.GetCurrent().Name;
    string[] paramsLogin = domainUser.Split('\\');
    txtUser.Text = paramsLogin[1].ToString();
    txtDomain.Text = paramsLogin[0].ToString();
}

Translates to:

If Page.IsPostback() = False Then
    Dim domainUser As String = System.Security.Principal.WindowsIdentity.GetCurrent().Name
    Dim paramsLogin As String() = domainUser.Split('\\')
    txtUser.Text = paramsLogin(1).ToString()
    txtDomain.Text = paramsLogin(0).ToString()
End If

There are also plenty of good converters.
I googled: use windows credentials for form authentication to get that link - try finding a VB.NET link down a similar route...
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.