Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dotnetopenauth with asp.net mvc proving too frustrating to use

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.

like image 286
Ciel Avatar asked Apr 05 '10 01:04

Ciel


2 Answers

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 ;-)

like image 110
realMarkusSchmidt Avatar answered Dec 31 '22 22:12

realMarkusSchmidt


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.

like image 38
Athens Holloway Avatar answered Dec 31 '22 23:12

Athens Holloway