views:

306

answers:

3

I've been trying excessively hard to implement a good open id solution into asp.net mvc - and everywhere I turn is absolute dead ends. DotNetOpenAuth is just too big and I have been thusfar unable to get even the most simplistic, basic, absolute cut and dry implementation of it to work.

NerdDinner had a promising implementation, but it is impossible to track down all of the dependant files and scripts. The DotNetOpenAuth website has virtually no information that helps, either, unfortunately.

Does ANYONE know of a simple approach to just implementing this that actually explains and details how it is working with some kind of selector? It is talked about so much, but everything I find for it is so difficult to work with that it is really putting my whole team off from even considering it.

We want to implement it similar to how stack overflow already does - using a selector that'll popup a login page if it needs to. I realize there is a lot of code that needs to be done for this, but everything just hails and praises dotnetopenauth, and nothing really teaches it. Even the sample projects do not open or compile.

It looks like a wonderful library - but it really just isn't clicking for me.

EDIT : It's making a lot more sense now that I was pointed to the proper place to start. It's a lot less frustrating if you prune away all of the excess and know exactly where the basics are.

+3  A: 

I guess you probably started with the new DNOA project templates that contain A LOT of code and quite a complex database scheme, but most of it is only necessary for OAuth and OpenID providers, not relying parties. This can be a little overwhelming when you try to figure out how to integrate this into an existing solution.

I would recommend to not start with the project template, but with the sample project you can find in the Samples/OpenIdRelyingPartyMvc folder. To even minimize this, all you need for a very basic scenario (that would be e. g. just to be able to display the OpenID URL of the user that just signed in) is in the Authenticate method of the UserController. It's just a few lines.

In my case, after getting started based on this sample very quickly, I digged a little deeper into the code generated by the project template, learned and applied some useful improvements, but still very lightweight and simple, and it works great so far for me.

BTW: I think DNOA is not only perfectly engineered and the code well documented, but it's also one of the best supported open source libraries I ever used. I bet Andrew will leave a comment here in less than 24 hours ;-)

markus
I'm not saying there is anything bad about the library, but it does make a lot of assumptions about the developer, considering that openid is intended to be so widely propagated, it is very confusing to get used to.
Stacey
Going with that sample did work better. So my goal from here is to set it up with a selector - where would you recommend going from that sample to setting up a very simplistic selector?
Stacey
Hrnm.. I am still really lost as to how the page knows where to send the user to login to their provider of choice...
Stacey
The very latest download of DNOA already contains a selector. I ended up using this selector: http://code.google.com/p/openid-realselector/ You just have to make sure that the name of the form field in your server-side code matches the name of the text box used in the javascript code.
markus
See, this is where I think DNOA gets a bit too complicated for the beginner coder. If it had been made clear that the selector was just a client side writeup to pretty-up the display, it would have been SO much easier to break into. That much said, I am very much impressed with DNOA now that I can get the mvc sample working. Thank you so much for your help!
Stacey
LOL LOL, Markus. Funny man. Thanks for the kudos, and answering the question. Just one comment: the project template's database schema, while "complicated" is for OpenID RP + OAuth SP. There's no "OpenID provider" schema in there. But the schema can absolutely be simpler if you don't need OAuth SP support or you're not running on a web farm.
Andrew Arnott
I knew it ;-) Seriously, I'm really impressed with all the time and patience you take with user feedback on the mailing list, here on SO, on twitter etc. Thanks for clarifying what the database model is all about. I just quickly figured out that it's obviously overkill if all you want is to persist an OpenID URL -> User relationship.
markus
+3  A: 

Try this. http://www.west-wind.com/Weblog/posts/899303.aspx.

dotnetopenauth includes a sample asp.net mvc app that demontsrates how it works. I evaluating it before switching to spring mvc but was able to develope a functional POC based on the logic in the sample code. If i recall correctly, your view includes a textbox that submits the openid to the controller and the controller uses the dotnetopenauth api to redirect you to the open id provider for authentication. The redirect includes the url to your site via the querystring so the open id provider can redirect you back once you authenticate. Your controller will use the dotnetopenauth api again when the end user is rediected back to your site and you are able to extract the open id. I know this only explains what you mayalready know butlike i said I had no problem getting it to work. post your code. I coded in a vm and cannot acces anymore but i'm downloading it again now. this sounds like good blog material.

Athens
A: 

I am using asp.net MVC framework. On my page i have a dropdwonbox and when an option is clicked i want to go to another page. But i can’t find how/where to set the autopostback property to true.

fico score