Integrating OpenID and ASP.NET MVC

OpenID (Microsoft Passport done right), is gaining a lot of popularity and it’s common to see it integrated into new and existing web sites. For those not familiar with OpenID, here’s a quote from the web site:

 

For geeks, OpenID is an open, decentralized, free framework for user-centric digital identity. OpenID takes advantage of already existing internet technology (URI, HTTP, SSL, Diffie-Hellman) and realizes that people are already creating identities for themselves whether it be at their blog, photostream, profile page, etc. With OpenID you can easily transform one of these existing URIs into an account which can be used at sites which support OpenID logins.

I’m currently working on a project with ASP.NET MVC and since it requires a login, I decided to offer the option for users to use OpenID as a means of authentication. The "de-facto" library of choice it seems is .NET OpenID which is available on Google Code. It actually comes with a demo of how to use it with ASP.NET MVC but I have a feeling it was done with the very first CTP of MVC since there are direct accesses to the form object, etc. which isn’t really necessary. Having said that, the library is extremely easy to use and I was up and running in about 5 mins. You can download the updated demo below. The code is extremely straight-forward, but if you have trouble understanding anything, just ping me.

One thought on “Integrating OpenID and ASP.NET MVC

  1. Adron

    I tried out that example, it couldn’t have been more to the point. 🙂 Dug it.

    Will hopefully be posting some examples of various Open ID integration samples along with other things myself soon.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s