DotNetOpenAuth / WebSecurity Basic Info Exchange

Posted by Jammer on Stack Overflow See other posts from Stack Overflow or by Jammer
Published on 2012-11-20T10:57:46Z Indexed on 2012/11/20 10:59 UTC
Read the original article Hit count: 266

I've gotten a good number of OAuth logins working on my site now. My implementation is based on the WebSecurity classes with amends to the code to suit my needs (I pulled the WebSecurity source into mine).

However I'm now facing a new set of problems. In my application I have opted to make the user email address the login identifier of choice. It's naturally unique and suits this use case.

However, the OAuth "standards" strikes again.

Some providers will return your email address as "username" (Google) some will return the display name (Facebook). As it stands I see to options given my particular scenario:

Option 1 Pull even more framework source code into my solution until I can chase down where the OpenIdRelyingParty class is actually interacted with (via the DotNetOpenAuth.AspNet facade) and make addition information requests from the OpenID Providers.

Option 2 When a user first logs in using an OpenID provider I can display a kind of "complete registration" form that requests missing info based on the provider selected.*

Option 2 is the most immediate and probably the quickest to implement but also includes some code smells through having to do something different based on the provider selected.

Option 1 will take longer but will ultimately make things more future proof. I will need to perform richer interactions down the line so this also has an edge in that regard.

The more I get into the code it does seem that the WebSecurity class itself is actually very limiting as it hides lots of useful DotNetOpenAuth functionality in the name of making integration easier.

Andrew (the author of DNOA) has said that the Attribute Exchange stuff happens in the OpenIdRelyingParty class but I cannot see from the DotNetOpenAuth.AspNet source code where this class is used so I'm unsure of what source would need to be pulled into my code in order to enable the functionality I need.

Has anyone completely something similar?

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about oauth