Friday, August 31, 2007

Mmm Valium

Last Wednesday I experienced an hour of pure adrenaline. I went to my motorbike lesson only to find out it was time to leave the parking lot and head out onto the streets. I was given 20 minutes of on-paper instruction on how not to get killed and then got the keys to a bike. It was pretty intense suddenly being in the middle of Amsterdam and having to take traffic into account. I made plenty of small mistakes (forgetting to check mirrors, forgetting to signal) but those I could live with. I made one big mistake and that was using my front brake in a turn. I wasn't going fast at all but I felt I couldn't make the turn and did the dumbest thing one can do - pull the front brake. The bike got sucked down to the pavement and me with it. I walked away with a slightly sprained ankle and had no problems finishing the ride.

Later that evening I realized my back was stiff as hell and getting quite painful, while the adrenaline had worn off so I was feeling the ankle. After a relatively sleepless night I went to the doctor in the morning. I told him of my adventures so he gave me some painkillers as well as something to relax my muscles the next night. I'm not too well versed in drugs so I looked them up before I took them, and the muscle relaxant happened to be diazepam which I figured out was actually Valium. That took me a bit by surprise, I didn't realize Valium could be used for this type of thing. Well I tried one last night and it worked. At this point I can sleep without it though, so I have a few spare ones. I wonder if I can feed them to the birds outside my window, maybe they'll shut up before 10 am.

Monday, August 27, 2007

The funniest TechNet article

I can't believe that TechNet posted this. It is by far the funniest TechNet article I have ever read and I am glad to see that MS has a sense of humor.

Wednesday, August 15, 2007

Motorbike lesson #2

My second motorcycle lesson can be summed up in two words: Much better. It's good to know that I am not motorcycle-challenged and that I am making progress. Next lesson will involve some speed, so that should be fun.

In other news, Ryan and Alex arrived yesterday. Due to the courtesy of BA, they showed up sans luggage so we sat at my place chillin and waiting for Ryan's bag to show up most of last night. When it did show at 00:30 we decided to try and catch one last beer at the bar but found that the only place open was comparable to a sardine can. Not fun. So tame night overall. I have a feeling that might not be the case tonight or tomorrow.

Friday, August 10, 2007

moss forms auth with commerce server provider error

I have been struggling with getting MOSS to use Commerce Server 2007 as the authentication provider and just finally made it work today. The last hurdle I had to get over was one that I solved by luck as much as anything else.

If you follow the Microsoft white paper at it explains how to get this integration done. For the most part it is a good guide except that it uses the typical developer security simplifications where many security accounts are grouped into a few uber-accounts. This can create some security headaches if you actually create all the accounts that are recommended in the official MS installation docs for MOSS and CS.

Once I got all these issues figured out though, I managed to get my portal to show me a login screen. When I logged in with a bad password, I got the expected behavior - a nice error message. When I logged in with a correct user/password combo I got something strange. The page just posted back to itself with no message. Fiddler and the IIS logs were showing that the browser tried to go to the homepage but the server returned a 302. Weird.

After some blind stumbling I fond the solution. The white paper comes with a number of handy snippets for the web.config file that you need to create. One of these snippets is for forms authentication, replacing the windows authentication your portal likely uses. Very handy. The problem lies in the line:

<forms loginUrl="/_layouts/login.aspx" domain="" name=".ASPXFORMSAUTH" />

Notice the domain attribute? That is the domain that is stuck into the cookie your server sends out. So unless you change this, the user authenticates against some other domain and is not seen as authenticated against your domain. Nice huh? Once I changed this to my test domain, my portal worked again.

Motorbike lesson #1

Yesterday I went for my first motorcycle riding lesson. It was fun and ended well, but due to some miscommunication on how I should be riding I did wipe out three times. I took what the instructor said too literally. I was supposed to be making slow narrow turns and he said "just use your hips and lean the bike". OK. Dumbass me at that point says "So I can't turn the handlebars?" He told me no, and so I proceeded to attempt slow and narrow turns with the handlebars completely straight. Almost-wipeout, wipeout, almost-wipeout, wipeout, etc. You get the picture. He kept trying to explain to me what he thought I was doing wrong, but only after he put me on the back of the bike and showed me did I understand my mistake. I told him he WAS using the handlebars to turn where he said it wasn't him, the bike causes them to turn that way. Duh. I felt like a retard for a bit but after that small fiasco I was driving circles around the guy (literally). Looking forward to the next lesson.

Thursday, August 09, 2007

MOSS Debugging Tip

I found a very useful change in the web.config file of SharePoint when you need to debug something. If an exception occurs in your code, SharePoint will normally display a nice page with a generic “An error occurred” message. This is fine for end users but awful for debugging. To turn this off, change:

<safemode maxcontrols="200" callstack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">


<safemode maxcontrols="200" callstack="true" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false">

You will then get the typical ASP.NET error page with the exception and call stack.