views:

1397

answers:

8

I am starting to build a new web application that will require user accounts. Now that I have an OpenID that I am using for this site I thought it would be cool if I could use OpenID for authentication in my application. Are there any good tutorials on how to integrate OpenID with an ASP.NET site?

+5  A: 

DotNetOpenId available at http://code.google.com/p/dotnetopenid

Nick Berardi
+3  A: 

I'm considering the same thing. On the Open ID site, there's a link 'For Developers' @ http://openid.net/developers/ and from there is a link to 'Open Libraries' @ http://wiki.openid.net/Libraries and finally from there is one called 'DotNetOpenID' @ http://dotnetopenid.googlecode.com/ which is probably what you're looking for.

Good luck.

Jason Shoulders
A: 

You should check out the DotNetNuke codebase as well, they have been using OpenID for the last several revisions, and you'll find working code for implementing it there.

Purple Ant
+16  A: 

See Scott Hanselman's post on using DotNetOpenID in ASP.NET. Andrew Arnott's blog is full of samples on using DotNetOpenID with ASP.NET, including ASP.NET MVC.

I recently hooked up DotNetOpenID for the Subtext 2.0 release. It went really smoothly - the code samples included with the DotNetOpenID download are pretty helpful. The one thing I'd recommend is that you just use the library and avoid the ASP.NET control. It uses table based layout (hardcoded) and is pretty difficult to restyle.

Jon Galloway
Just a note that there are several ASP.NET controls in the library. OpenIdLogin is as you say. But OpenIdTextBox is much simpler (UI wise) and is more CSS friendly.
Andrew Arnott
+4  A: 

Are there any good tutorials on how to integrate OpenId with an ASP.NET site?

Andrew Arnott's post titled "How to add OpenID to your ASP.NET web site (in C# or VB.NET)"

Jason Bunting
+1  A: 

Thanks to everyone who suggested DotNetOpenID and the related tutorials. This is exactly what I was looking for.

dlannoye
+1  A: 

DotNetNuke may not be a good current example. When we did the integration, DotNetOpenID was not currently supporting OpenID 2.0 spec. I hacked together a fork to get the 2.0 support and have not had a chance to rip it back out for the official DotNetOpenID 2.0 release.

Joe Brinkman
A: 

can anyone help in using the OpenID with ASP classic.

I tried the DotNetOpenID, but I get the error that server object cannot be created !?

Part of the Script I tried : <% dim realm, thisPageUrl, requestUrl, dnoi, authentication

realm = "http://" + Request.ServerVariables("HTTP_HOST") + "/classicaspdnoi/" thisPageUrl = "http://" + Request.ServerVariables("HTTP_HOST") + Request.ServerVariables("URL") requestUrl = "http://" + Request.ServerVariables("HTTP_HOST") + Request.ServerVariables("HTTP_URL")

Set dnoi = server.CreateObject("DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty") Set authentication = dnoi.ProcessAuthentication(requestUrl, Request.Form)

%>

I get the following error:

Server object error 'ASP 0177 : 800401f3' Server.CreateObject Failed /openID-test.asp, line 9 800401f3

Please advice good help on the matter.

Rajeev