August 2005 - Posts

Tech Ed NZ 2005 Day 3

I started with a useful session on ASP.NET 2 membership and role management. I spent the rest of the morning doing labs, and am now officially tired.

Tech Ed NZ 2005 Day 2

Developer content this year seems a bit thin. I think part of the reason is that most of what we're hearing about has been delayed for so long that for anyone who's been tracking it closely there isn't much to add at this stage, and Tech Ed NZ comes so long after the US version that by now all the cats are long out of the bag.
The labs are good though.
I attended a session this afternoon on Web Service enhancements in .NET 2 ...really just incremental improvements, but that's fair enough . I am however looking forward to Indigo I mean the WCF and the DataContract: then we'll finally have civilised support for loose coupling and Contract First web service development.
I also got some good info on the navigation controls in ASP.NET 2 - the bit I hadn't been aware of was how well the SiteMap integrates with ASP.NET security and roles.

Tech Ed NZ 2005 Day 1

I just got my hands on an HTC Universal at the Vodafone booth. It's much lighter than I expected, and not as bulky as it looks in photos. The keyboard is very nice, and has two special keys mapped as soft keys. Oddly enough I couldn't find anything equivalent in portrait mode, but further exploration might reveal something.
I definitely want one of those.
On the subject of actual conference content: I like the enhancements to the Event Log in Windows Vista. Being able to trigger tasks from events will be very helpful.

I learned something today about IPrincipal and ASP.NET security

I've been looking into implementing a RoleProvider for our ASP.NET applications at work, partly to ease the upgrade path to ASP.NET 2, partly because it's inherently useful for our requirements and partly because I'm interested in the provider pattern for a number of potential uses.

So anyway, I was poking away in the documentation and bits and pieces trying to get an appreciation of how the ASP.NET 2 roles management system works, and I finally realised that they don't assign roles when the first request is authenticated, which is what I've been doing for the past few years (creating a generic principal, assigning roles to it and then assigning it back to Context.User).
After a bit of experimentation (which involved writing a class I call "StupidPrincipal", which returns true when queried for membership of certain hard-code roles and false for anything else) I now know that the ASP.NET authorisation mechanism actually calls the current user's IsInRole(...) method for the roles specified in the Web.config - a nice and simple approach.
The beauty of only retrieving roles when IsInRole(...) is called (and then caching them of course if desired) is that a single role/principal system can be used across all your web applications regardless of whether they all use roles or not, and there's no danger of wasting time and resources trying to retrieve a list of roles for an application that doesn't use them...which also means that a single application can switch between using roles and not using them (or vice versa) without having to yank out or otherwise play around with authentication code.
I like that.

Updated 28/08/2005
I removed the reference to exactly which roles I was using, since the Community Server nannyware was replacing one of them with "***".
I'm glad this isn't a historical blog, or as I'm about to demonstrate it would be impossible to mention the original title of William the Conqueror, who was previously known as William the *** (and it's worth noting that on arrival in England he demonstrated that he was a *** in the slang sense as well. With bells on). And yep, that's the word I used as a role name. The other one was Manager - not a good choice I know since they might be regarded as interchangeable.


 

Diarist v1.1 Released

The latest version of my blogging application for Pocket PC can be downloadedIf you'd like to try it, ask for a copy via the Contact form - I'm currently between hosters.

Update for Community Server Users:
I've just discovered that the structure used to pass credentials to the web service changed between 1.0 and 1.1.
If you're a 1.1 user you will therefore have problems with the web service option right now - I'm working on this and hope to post an update soon.

Update to the Update:
I've just posted an amended version which takes care of this problem.
It provides separate menu options for v1.0 and v1.1 of Community Server (including on the switch menu).

I tried to think of something clever to do with the WSDL to solve the issue, but ended up adding another proxy <grrrrr>.