Getting a Windows Username

Topics: Customizing Orchard, Writing modules
Sep 4, 2012 at 9:47 PM

Good Afternoon,

I have created an intranet site for my company and I am trying to get the Windows account name of the user accessing the site. I created a rule for a form to e-mail the content to myself and the person that issued it. Rather than relying on the end-user to type in the address I would like the form page to collect the username and pass it to the rule to email that user. What would you guys suggest?

Sep 5, 2012 at 12:53 PM

As far as I'm aware, unless you switch from forms authentication to windows authentication, the client's windows account isn't available - that would present rather a security risk on the wider web.

A possible alternative if you don't want to use windows authentication, but you have standardised on your browser, is to get the username in javascript and push it into a hidden field - this works on firefox and internet explorer.

Sep 5, 2012 at 1:57 PM

I decided to go the Windows Authentication route since it is an intranet site. Can you possibly explain to me what I need to do to get this to work? Other than HTML/CSS, I am not really a programmer so any tips to get this to work would be excellent.