In the last loooong post, the one about using CardSpace together with the new Receive activity featured by the Beta1 of the framework 3.5, I mentioned I would have attached the final solution: however I didn't do it right away, to give some incentive to actually go through the simple steps of the tutorial. Hehehe I know, I'm evil at times 🙂 I am now attaching the solution in this post: it is not commented nor documented, and it is very rough cut: it is exactly what I built while I was writing the tutorial.
About the sample in itself. In order to keep everything as readable as possible I placed the logic for accessing the claims directly in the code activity; that would also happen in a real application, if the actions of your code activity are somewhat infuenced by the value of a claim. However if you'd be performing pure claim validation the right place to put your claim code would be the OperationValidation handler of the Receive activity (explore the properties of the Receive activity in Visual Studio and you'll find it). Thanks Matt for pointing it out