David Christiansen | davidchristiansen.com

How simple is a OpenID Connect Basic client? (C#) Jul 16

John Bradley has just posted a great entry demonstrating how simple life is going to be for a Relying Party when it comes to OpenID Connect. I highly recommend you go and read it.The sample code in John’s post is in PHP so I thought I would quickly provide the same samples in C#. here we go.

DotNetOpenAuth: Debugging and Tracing OpenID and OAuth on ASP.NET (or MVC) using Glimpse Jul 11

Synopsis: Understanding exactly what is happening under the hood when it comes to working with OpenID and OAuth can be challenging even for the seasoned IDM developer. What I have found to help, is being able to see the communications between all the parties involved. Fortunately the DotNetOpenAuth library can be told to expose a plethora of information to the developer via integrated logging. In this post I will talk about a project called Glimpse that exposes a whole host of information to you, the developer, directly within the browser and then I will introduce a Glimpse plugin I have written that exposes all that lovely juicy information directly from DotNetOpenAuth.

In Short

  1. Get DNOA4Glimpse:
    NuGet Command: PM> Install-Package DCCreative.DNOA4Glimpse

What is Glimpse?
(http://getglimpse.com/About)

WhatIsGlimpseGlimpse is a very cool set of utilities that provide developers with a massive array of how requests go about being served, as well as a host of other information about the server itself.

At its core, Glimpse allows you to debug your web site or web service right in the browser. Glimpse allows you to "Glimpse" into what's going on in your web server. In other words what Firebug is to debugging your client side code, Glimpse is to debugging your server within the client.

Glimpse is available via NuGet at http://nuget.org/List/Packages/Glimpse.

Exposing DotNetOpenAuth to Glimpse

CropperCapture[2]

Writing a plugin for Glimpse is childsplay. Glimpse exposes a friendly Plugin interface

public interface IGlimpsePlugin
{
	string Name { get; }
	object GetData(HttpContextBase context);
	void SetupInit();
}

Simply inherit from IGlimpsePlugin then implement the members in your plugin.

[GlimpsePlugin]
public class DotNetOpenAuthPlugin : IGlimpsePlugin {
	public void SetupInit() {
	//...
	}
	public string Name {
		get { return "DotNetOpenAuth"; }
	}
}

After adding a reference to the assembly containing your plugin, Glimpse will automatically pick up your plugin (thanks to the wonderful powers of MEF).

Demo

I quickly threw together a sample application to test the plugin.

  1. Create a new ASP.NET MVC site based on the DNOA MVC relying party sample.
  2. Add the DNOA4Glimpse package (Install-Package DCCreative.DNOA4Glimpse)
  3. Done (Get the source here)

CropperCapture[2]

Glimpse has been turned on (by visiting //yourwebsiteurl.example.com/glimpse.axd) which results in a panel being displayed at the bottom of your screen. As you can see, there is a DotNetOpenAuth tab. Awesome!

Right, now – let’s do an OpenID Authentication

CropperCapture[4]

What’s really cool is the Glimpse’s handling of complex objects.

CropperCapture[5]

The presentation of complex objects such as the YADIS services detailed above will improve in a version I am currently working on, thanks for some new presentation features coming to Glimpse soon. Watch this space.

So the plugin is still in beta but hopefully you will find it useful.

DNOA4Glimpse and Demo Source is available at https://github.com/DavidChristiansen/DNOA4Glimpse

An afternoon with Glenn Block – Leith, Edinburgh 12th March 2011 Feb 22

CropperCapture[1]

Exciting news.

I am proud to announce that Glenn Block from Microsoft will be coming all the way from Seattle to Scotland on the 12th March to talk to you!. Glenn is a PM on the WCF team working on Microsoft’s future HTTP and REST stack and has been involved in some pretty exciting and ground-breaking Microsoft development mind-shifts in recent times.

Don’t miss the chance to hear him speak and ask him questions. The day will be split into two parts.

Favourite subjects from The Block
The first couple of hours will see Glenn focus on talking about his current work basket – expect to see him talking about Windows Communication Foundation, web APIs, HTTP, REST, MEF, Patterns & Practices and his experiences at the recent mvcConf 2 event!

Block unblocked chalk talk - your chance to ask Glenn anything he can answer
The second half of the afternoon will be "yours" - a chalk'n'talk if you prefer. It will be your chance to have an open and frank conversation with Glenn, to ask him questions, to challenge him and to get answers to those questions that you’ve been saving for such a celebrity!

Book your for ticket here (Tickets are Free!)

Brief history of Glenn

Glenn is a PM on the WCF team working on Microsoft’s future HTTP and REST stack. Prior to WCF he was a PM on the new Managed Extensibility Framework in .NET 4.0. He has experience both inside and outside Microsoft developing software solutions for ISVs and the enterprise. He has also been active in involving folks from the community in the development of software at Microsoft. This has included shipping products under open source licenses, as well as assisting other teams looking to do so.

Glenn is a featured blogger over at CodeBetter, read what he’s writing about here: http://codebetter.com/glennblock/author/glennblock/

His official Microsoft blog can be found here: http://blogs.msdn.com/b/gblock/

Glenn Block on the web

Sponsored by

stormid
Storm ID is an award winning full service digital agency in Edinburgh

LogParser–Graphing PING results Jan 25

Here is a nifty little example of how to pipe console output to Microsoft LogParser, in this case the results of a ping against Google.

ping -n 15 www.google.co.uk | "%pathTologparser%\LogParser"
"SELECT TO_INT(REPLACE_STR(EXTRACT_VALUE (Text,'time',' '),'ms',''))
AS Response INTO Ping.gif FROM stdin WHERE Text LIKE '%%Reply%%'
GROUP BY Response" -i textline -legend off -chartTitle "Ping Times" -view

Note: I have inserted line breaks for readability, this should be written as one line.

Replace %pathTologparser% with the path to your local LogParser installation, typically c:\Program Files\Log Parser 2.2 or c:\Program Files (x86)\Log Parser 2.2 on x64 installations.

FIX: nHibernate/log4net in windows service. FileNotFoundException Jan 20

When using nHibernate in a windows service you may find that you encounter FileNotFoundExceptions when trying to load assemblies or external configuration files. Typically this is in scenarios where you are running your service under a user context such as NetworkService.

If you hunt around long enough you will find that it is trying to locate said files in the %WINDIR%\system32 folder (for example c:\windows\system32), and not from the services own directory.

By default window services set the default directory to the %WINDIR%\system32.

Simply change your service's default directory to wherever your service is running.

Here's a sample:

// Set current directory to assembly folder
// Need to to this so can find the configuration file for the logger
// default is %WINDIR%\system32 for window services
static void Main(string[] args) {
	Environment.CurrentDirectory = System.IO.Path.GetDirectoryName(
System.Reflection.Assembly.GetEntryAssembly().Location); ///... }