views:

444

answers:

4

I am trying to figure out how to get DotNetOpenAuth(http://www.dotnetopenauth.net/) working in my webforms app

I don't understand where to begin. I have an OpenIDSelector on my Login.aspx that lets you choose google or Yahoo. You can choose one, then a popup comes up, and lets you login. Once you login the program hangs because it is trying to do something with a database???

Can't I just use some control(like the OpenIDSelector) and get back that the user was authenticated, get their ClaimedID and handle the rest myself?

EDIT: Trying to get started with OpenID in Webforms? Go Here...

http://www.dotnetopenauth.net/developers/code-snippets/programmatic-openid-relying-party/

A: 

1 - claimed identifier is what you're looking for. the issue is that google and the like use 'directed identity', which means that the claimed identifier will be linked to the realm you come from. net result for you - the same user may come through under multiple different claimed identifiers.

2 and 3 i don't know about - i'm assuming this is some out-of-the-box functionality DNOA does, but i haven't played with it.

4 - not that i've found. dnoa covers all the cases you need to worry about.

kolosy
I have no clue how to get this going without the template project, which seems really bloated. You know of a resource?
Blankasaurus
yeah - there's plenty of documention on the DNOA site. see andrew's response.
kolosy
+1  A: 

You don't need to use the project template. You can drop the OpenIDSelector control into any web app and it will Just Work in the minimalist "give me the username" way out of the box. There's no SQL dependencies whatsoever in the DotNetOpenAuth library. Just handle the OpenIdSelector.LoggedIn event and you'll get the username you want.

The project template, bloated as it may seem to you, assumes you actually have user data to store, and that you want to provide a reasonable log in and account management experience. It also works in web farms and cloud hosted environments. If you're starting from scratch this is a great way to get started, although naturally some code that it comes with will apply less than others, which is why you have the source -- so you can change it.

Yes, the project template includes a dependency on a database. It uses Linq-to-Entities so any database with an Entities provider works -- not just SQL Server. And it comes with the schema for that database built in. Just run setup.aspx and it should create the database for you in your local SQLExpress install.

Andrew Arnott
http://www.dotnetopenauth.net/developers/code-snippets/programmatic-openid-relying-party/ is what I was looking for. Exactly what I needed. Unfortunately I don't see an obvious way to find it from dotnetopenauth.net home (I found it on my 500th google search trying to figure out how to make it work). This is what I would imagine would be in a "Getting Started" section.
Blankasaurus
Good feedback, CccTrash. I'll find a way to make that more discoverable.
Andrew Arnott
+2  A: 

This answers all my questions, concise getting started for webforms, helps one to understand how it all works.

http://www.dotnetopenauth.net/developers/code-snippets/programmatic-openid-relying-party/

Blankasaurus
+1  A: 

here's a step by step linked to from their website. http://www.plaxo.com/api/openid_recipe

localman