ExtremeSwank


OpenID Consumer for .NET 2.0

Last updated on May 7, 2008

Information at Google Code

Introduction

ExtremeSwank OpenID Consumer gives you an easy way to add OpenID logins to your ASP.NET website or non-web .NET applications. It offers the following features:

Please follow the code examples below and read through the online documentation. If available, use the Chat window to ask questions, or log in and leave a comment below. If you run into any bugs, please file a bug report on the Google Code site.

Download

ExtremeSwank OpenID Consumer is released under the MIT license. You are free to distribute, modify, and copy code without limitation.

This project is hosted at Google Code.


Comments

Important: If you are having a problem with using this library with a specific OpenID provider, please do not leave a comment here. Please file a bug report on Google Code.

You must be logged in with your OpenID to post comments.

Date: 04/17/2008 at 12:34:58
Poster: johnnyfartpants.myopenid.com

Hi,

Just wanted to thank you for your quick attention to the bug report I submitted (re: ProtectNetwork). Just FYI, I've alerted them to the fact that their OpenID implementation is broken.

Thanks for a great library.

Date: 04/08/2008 at 12:21:09
Poster: mcdona22.myopenid.com

could you please extend the simple usage scenario whnere you authenticate an openId user to recover the attributes for that particular user. failing that pointing me to where I can do that for myself would be great.

Date: 03/24/2008 at 20:36:47
Poster: extremeswank.com

Neil,

In response to your first comment, the library was correct to authenticate successfully. myopenid.com will automatically redirect the OpenID Consumer to the correct page if the dot is left out of the OpenID (for instance, neilyoung vs. neil.young). This means that the discovery completed successfully, and you got a positive assertion, which is correct.

As for failing after hitting the refresh button, this is normal to protect against "replay" attacks, which could allow someone else to log in as you by simply sending the same data again.

As for your second comment, this issue is now resolved in version 3.0.4.1. Previously, you had to perform a redirect after the successful validation to ensure the arguments were cleared from the request. I have modified the library so it will automatically remove all the arguments that can cause problems when you submit the next authentication request.

Thank you for your feedback!

---

Thomas,

The OpenID login on this page is provided through a different implementation (AuthOpenID Snippet for MODx). Therefore, the best way to check if the .NET implementation will work for you is to download it and try it out.

Thanks!

Date: 03/22/2008 at 12:52:44
Poster: neil.young.myopenid.com

Another monitoring: Could someone please help me to interpret the following flow:

1) Initial load of the aspx page
2) Click Login with a valid ID, BeginAuth is called
3) PageLoad, RequestedMode.IdResolution, Validate OK

4) Click "Login" again, BeginAuth is called, there is some traffic back and forth between your lib and myopenid
5) PageLoad is called, but OpenID.RequestedMode is None.

How shall I interpret that? It is neither OK, nor FAIL, but what is it?

Regards

Date: 03/22/2008 at 12:33:47
Poster: neil.young.myopenid.com

Hi,

thanks for your efforts creating a .net lib. I have an issue, probably you are able to comment.

I wrote a small .net web app, using the simple scenario above. Mistakenly I initialized the loginbox with the wrong id (neilyoung.myopenid.com). The very first login attempt started with beginauth() and ended up in validate() == true. After that I performed a couple of browser refresh's on my page. Every subsequent validate did fail (what should be the right result of the first attempt too, from my POV).

Here the trace of the LOGIN:
openid Initializing OpenID Consumer 1,92856969251679 1,928294
openid Loading extension plugins 1,9287054639626 0,000136
openid Finished initialization 1,9288202830248 0,000115
openid Identity received (http://neil.young.myopenid.com/) and expected (http://neilyoung.myopenid.com/) do not match. Verifying that the OpenID server is authoritative for both IDs. 4,67897819415596 2,750158
openid Creating HTTP Request. 4,67903574336962 0,000058
openid URI: http://neilyoung.myopenid.com/ 4,67905501956254 0,000019
openid HTTP Request successful. Passing to discovery plugins. 6,08710967455361 1,408055
openid Trying plugin XRDS Discovery Plugin 6,08719264599272 0,000083
openid Trying plugin Yadis Discovery Plugin 6,08724349044362 0,000051
openid URI: http://neil.young.myopenid.com/xrds 6,08734406188496 0,000101
openid Plugin discovered endpoint. 6,70220488916887 0,614861
openid Delegated OpenID. 6,70228562568706 0,000081
openid Discovery successful - http://www.myopenid.com/server 6,70233814632865 0,000053
openid Creating HTTP Request. 6,70239122570047 0,000053
openid URI: http://neil.young.myopenid.com/ 6,70242502887937 0,000034
openid HTTP Request successful. Passing to discovery plugins. 7,31649385606271 0,614069
openid Trying plugin XRDS Discovery Plugin 7,3166103513156 0,000116
openid Trying plugin Yadis Discovery Plugin 7,31666063703627 0,000050
openid URI: http://neil.young.myopenid.com/xrds 7,31674500530095 0,000084
openid Plugin discovered endpoint. 7,93107950870851 0,614335
openid Delegated OpenID. 7,93115074681279 0,000071
openid Discovery successful - http://www.myopenid.com/server 7,93120298808927 0,000052
openid Verified that OpenID server is authoritative for the received identity. 7,9312563468262 0,000053
openid Stateful mode enabled, beginning validation check using shared key 7,93129545794228 0,000039
openid Looking up association in association table. 7,93134937540944 0,000054
openid Generating signature for tokens: assoc_handle:{HMAC-SHA256}{47e54350}{Pj0Sdg==}
claimed_id:http://neilyoung.myopenid.com
identity:http://neil.young.myopenid.com/
mode:id_res
ns:http://specs.openid.net/auth/2.0
op_endpoint:http://www.myopenid.com/server
response_nonce:2008-03-22T18:23:04ZehLfLZ
return_to:http://localhost/OpenID2/Default.aspx?cnonce=978264263
signed:assoc_handle,claimed_id,identity,mode,ns,op_endpoint,response_nonce,return_to,signed
7,9314915722529 0,000142
openid Expected signature: fGphuVs1CMDTYFFUvg0jG2Hdz9yBLF21aI8ZBhUBhTA= 7,93160108337791 0,000110
openid Generated signature: fGphuVs1CMDTYFFUvg0jG2Hdz9yBLF21aI8ZBhUBhTA= 7,93163795957307 0,000037



Here the trace of the failing browswer refresh:
openid Initializing OpenID Consumer 1,75155138432399 1,751259
openid Loading extension plugins 1,7516835240233 0,000132
openid Finished initialization 1,75176370181126 0,000080
openid Identity received (http://neil.young.myopenid.com/) and expected (http://neilyoung.myopenid.com/) do not match. Verifying that the OpenID server is authoritative for both IDs. 3,41678006562287 1,665016
openid Creating HTTP Request. 3,41691863071983 0,000139
openid URI: http://neilyoung.myopenid.com/ 3,41725470695298 0,000336
openid HTTP Request successful. Passing to discovery plugins. 4,57955801645181 1,162303
openid Trying plugin XRDS Discovery Plugin 4,57962087360265 0,000063
openid Trying plugin Yadis Discovery Plugin 4,57964881011413 0,000028
openid URI: http://neil.young.myopenid.com/xrds 4,57970021329526 0,000051
openid Plugin discovered endpoint. 5,19414087544646 0,614441
openid Delegated OpenID. 5,1941906024369 0,000050
openid Discovery successful - http://www.myopenid.com/server 5,19423558022039 0,000045
openid Creating HTTP Request. 5,19426603101791 0,000030
openid URI: http://neil.young.myopenid.com/ 5,19428502784572 0,000019
openid HTTP Request successful. Passing to discovery plugins. 6,53062721658758 1,336342
openid Trying plugin XRDS Discovery Plugin 6,53070711501043 0,000080
openid Trying plugin Yadis Discovery Plugin 6,53075656263575 0,000049
openid URI: http://neil.young.myopenid.com/xrds 6,53085517852129 0,000099
openid Plugin discovered endpoint. 7,07286847909441 0,542013
openid Delegated OpenID. 7,07294083465915 0,000072
openid Discovery successful - http://www.myopenid.com/server 7,07299419339609 0,000053
openid Verified that OpenID server is authoritative for the received identity. 7,07304839022837 0,000054
openid Stateful mode enabled, beginning validation check using shared key 7,07309532356766 0,000047
openid Error: The cnonce is not valid. 7,07314281563718 0,000047
openid Validation failed, performing stateless validation check 7,07318052992769 0,000038
openid URI: http://www.myopenid.com/server?openid.assoc_handle=%7bHMAC-SHA256%7d%7b47e54350%7d%7bPj0Sdg%3d%3d%7d&openid.claimed_id=http%3a%2f%2fneilyoung.myopenid.com&openid.identity=http%3a%2f%2fneil.young.myopenid.com%2f&openid.mode=check_authentication&openid.ns=http%3a%2f%2fspecs.openid.net%2fauth%2f2.0&openid.op_endpoint=http%3a%2f%2fwww.myopenid.com%2fserver&openid.response_nonce=2008-03-22T18%3a23%3a04ZehLfLZ&openid.return_to=http%3a%2f%2flocalhost%2fOpenID2%2fDefault.aspx%3fcnonce%3d978264263&openid.signed=assoc_handle%2cclaimed_id%2cidentity%2cmode%2cns%2cop_endpoint%2cresponse_nonce%2creturn_to%2csigned&openid.sig=fGphuVs1CMDTYFFUvg0jG2Hdz9yBLF21aI8ZBhUBhTA%3d 7,07332635851763 0,000146
openid Server has not validated authentication response. Response received: Content-Length:51
Content-Type:text/plain; charset=UTF-8
Date:Sat, 22 Mar 2008 18:25:09 GMT
Set-Cookie:ephemeral_session_id=85618f24fc1658b4e82f52f1c6b498f1d64970098aee5ee211259d2dfdaf3ee2; domain=myopenid.com; path=/,session_id=10b3e3e4209dd299ba80d8a04994bbce1dd1e51dc98e7505bde22c5c17b19267; domain=myopenid.com; path=/; expires=Sun, 22-Mar-2009 18:25:09 GMT
Server:Apache/2.2
Connection:close
is_valid:false
ns:http://specs.openid.net/auth/2.0
8,98209465169456 1,908768



Date: 03/20/2008 at 15:51:38
Poster: thomascouey.pip.verisignlabs

Is anyone else having issues with delegation not working correctly? I've set it up on my web page as directed by the openid wiki, but it doesn't work on this page when I try to login with my website address. I have to use my actual openid provider long url. I use verisignlabs, if that matters. Oh, and I've tried using delegation with other sites that support OpenID, as well as with the UserControl (from above) and it works with those.

Date: 02/05/2008 at 14:16:05
Poster: extremeswank.com

Gusps,

The Attribute Exchange extension is not present in the current release (2.9.5). However, work is being done, and it will be included in the next release. - Thanks

Date: 02/05/2008 at 03:44:20
Poster: gusps.myopenid.com

Hi,
Is there any example about how to use AttributeExtension?
Thanks.

Date: 01/27/2008 at 21:44:07
Poster: inblues.myopenid.com

Hi, I'm using your code. It's cool code. But i got error message "Unable to locate Identity Provider." when try to login using OpenID from wordpress.com. Anyone can help? or any advice? Thanks

Date: 01/23/2008 at 15:38:43
Poster: extremeswank.com

Sky13,

I just tested my ID at Myopenid.com, as well as your's. The discovery code appears to be working just fine. You may want to check your DNS settings to make sure your ID is resolvable.

Also, please be kind and do not post multiple messages with the same content. If you want to get my attention faster, I suggest filing bug reports on the Google Code page. This will also give me a chance to actually ask you for additional information so we can troubleshoot the problem together.

Thank you!

Date: 01/22/2008 at 06:35:55
Poster: sky13.myopenid.com

Why I can come on your site under mine OpenID, on by means of this library I can not will be connected to a server when I enter mine OpenID registered on Myopenid.com OpenID provider?

Date: 01/21/2008 at 01:17:05
Poster: sky13.myopenid.com

I cannot enter with use of mine OpenID registered on myopenid.com. The program gives out a mistake: " Unable to locate Identity Provider. "

Date: 01/20/2008 at 16:37:49
Poster: openid.orange.fr/gillesbecav

Great job. I've done implementation on http://www.netassur.fr.
It seem's aol doesn't send back any field, even required. Are you aware about that ?
Another thing, I've seen messages are in error.cs, but how override them without recompiling the DLL (for translation) ?
Thanks for all.
Gilles BECAVIN

Date: 01/18/2008 at 08:45:51
Poster: sky13.myopenid.com

Does not work, that I not so do... Writes: " Unable to locate Identity Provider. " But I have entered here under the same name. In what part of a code there is an inquiry about server OpenID

Date: 01/16/2008 at 14:42:32
Poster: getopenid.com/coder

First of all: Great library! Thanks for the latest update!

Bit of frustration trying to figure something out. I can't get my code to work with "getopenid.com/coder" but it worked to login to this site. :(

I even just tried the code straight out of the zip file (without web extensions).

I get "Identity Provider refused request.". I've tried to step through the code a bit but can't figure it out.

Any help is appreciated.

Date: 01/07/2008 at 15:35:50
Poster: dotnetjoe.myopenid.com

Damn. Your code rocks. Rare to find so welldocumented and beautiful code. Do you plan to implement the server part as well? It would help OpenID to spread across the .NET community, I think.

Date: 01/02/2008 at 13:01:16
Poster: kwaclaw.myopenid.com

I took a look at BigInteger.cs, to remove unsafe code. First, I replace your Diffie Hellman / Security code with the newest checkout from Mono, and then I converted all unsafe code in BigInteger.cs from using pointers to using arrays.

I may have made mistakes, but there wasn't a lot of code to change. I doubt that performance will be impacted.

Anyway, let me know if you are interested.

Karl

Date: 12/28/2007 at 14:35:04
Poster: mave99a.myopenid.com

cool!

Date: 12/26/2007 at 01:48:18
Poster: technorati.com/people/techno

Hi, the downloaded sample not support OpenID format "http://technorati.com/people/technorati/inblues"?
I got error message "Unable to locate Identity Provider." when click on login.
Thanks

Date: 12/22/2007 at 10:23:17
Poster: pascal.craponne.o

The library works fine, except with identitu.de (who uses facebook accounts as backing account). It appears to send the usual data as a form post instead of query string. When modifying ExtremeSwank.Auth to use both QueryString and Form values, it just works.

Date: 12/10/2007 at 02:39:39
Poster: bassem.myid.net

is there any way to verify the open id without logging to the open id provider?

Date: 11/19/2007 at 08:59:58
Poster: troygoode.myopenid.com

RE: Diffie-Hellman in C#

You said to let you know if anyone finds a C#-only Diffie-Hellman implementation. Well, it appears someone has by utilizing the Mono project's BigInteger class. They (Pieter Philippaerts - Pieter@mentalis.org) have posted the code to do so at:

http://www.mentalis.org/downloads/DH.zip

Check out this thread for more info:
http://www.thescripts.com/forum/thread233317.html

Date: 10/04/2007 at 18:41:11
Poster: michaelrwebb.myopenid.com

Very nice library, this is just what I wanted. Nice use of the policy and registration capabilities. Will use it at http://www.tribalpizza.com/

Date: 10/03/2007 at 04:43:05
Poster: thebeebs.myopenid.com

This Library is great , I'll be implimenting it on www.thewayithink.co.uk. Thanks very much