Friday, October 2, 2015

ABCs of Windows Authentication in IIS

Well, first of all, you need to explicitly turn it on by enabling it. You'll find it by visiting the Authentication settings for a web site like so:

And then this needs to go in Web.config:

<authentication mode="Windows" />
<authorization>
   <deny users="?" />
</authorization>

 
 

Specifically this stuff needs to go inside system.web and not system.webServer. I recall once being told that system.web was for IIS6 while system.webServer was for IIS7, but that doesn't seem to be universally true. The authorization piece here doesn't need to be added for IIS6 to deny unknown users and force them to login, but you need it later versions of IIS. The "force them to login" thing looks like this:

Don't let Google confuse you here. In this example I am leaving Google in attempt to log onto an intranet app that needs the logging onto. The "Authentication Required" box appeared for me in Safari where I struggled to log in and in Firefox where I logged in just fine but not in IE or Chrome which seemed to just log me in, allowing me to sidestep the need to enter credentials. The login takes my active directory username and password. You're only gonna use this stuff for in-house intranet stuff. I really haven't researched how to interface with it from C# yet, but if you want to just show the name of who is logged in on the screen in a web forms app you may do so with a tag like this:

<asp:LoginName ID="Whatever" runat="server" />

Use COALESCE in T-SQL to have a fall over to value should an assignment be null.

SELECT @foo=COALESCE(@bar, 'baz')

"bang" is slang for exclamation mark

This comes up in conversations about passwords.

Thursday, October 1, 2015

nameof in C#

...is going to return a stringification of a variable name. The following test passes:

[TestMethod]
public void Test()
{
   Tuple<string,int> foo = new Tuple<string,int>("lucky",13);
   Assert.AreEqual("foo", nameof(foo));
}

explicitly permission the IIS_IUSRS group to access file folder permissions?

I used to think this was a must. I thought that when a user at large hits a web site that they are generically connecting as this group, but instead this group probably contains the App Pool users. You "hit" a web site as if you were the particular App Pool user for the site or application at hand.

Wacky awfulness happens when trying to interface with IIS6 at Windows Server 2003 with IE 10 and IE 11.

This has a write up... but maybe you should just get off of Windows Server 2003.

If you accidentally create a story instead of a defect in Rally there doesn't seem to be a way to convert it into a defect.

The gear symbol at the upper right will let you upgrade a defect into a story and a story into something called a "Portfolio Item" but to cannot walk in the other direction. Stories can have defects, etc. That's why.