VB.NET Mixed authentication mode & obtaining logged domain accout name from remote website?
Posted on 2009-12-29
Most users in my network environment logged into their system using domain accounts, which is managed by the company AD server. Most of their computers have joined the company domain, however, some haven't. The web application to be created is a portal service which will be hosted on one of the machines, and users will log onto the site remotely from their own machines or external network.
This situation requires mixed authentication to be used. The users will be able to directly bypass the login page when they logged into their computer that has joined the domain with their domain account. Otherwise, they will be prompted to the login page (computer not joined to the domain or access from external network) and manually input their domain user/pass to login.
I have no problem implementing the forms authentication and authenticate the AD via LDAP. However, I cannot get the NTLM authentication part working properly with VB.NET. Should I use Windows authentication mode or forms for my situation? I just cant find the right sample online.
During my testing, I have encountered problems when tried to obtain local User.Identity.Name from website hosted on remote server. For example, I logged into my computer A with "domain\steven". I want to access a website hosted on computer B and obtain "domain\steven", however, currently it returns the user logged for computer B. Furthermore, is it correct to obtain the domain account name logged for the currernt system by using User.Identity.Name and trim the machine name out afterwards?
Thanks for the help in advance.