I like the new MVC OpenID/OAuth login feature, but I want to know how to add a new login button, for example I want my users to login using their StackExchange account or using their OpenID url the same as in stackoverflow http://puu.sh/13rm0
How to do that? Are there any samples showing this in steps?
Unfortunately the API Microsoft exposes is limited to login providers that are hard-coded to a specific URL -- not one that can accept input from the user before logging the user in, which OpenID requires.
You can add support for specific OpenID providers such as StackExchange by creating a class that implements
DotNetOpenAuth.AspNet.IAuthenticationClient
and is hard-coded to use StackExchange. A great example of this is the source code for Microsoft's own provider for Yahoo!. Check it out, see how simple it is, then create your own that is simply hard-coded tohttps://openid.stackexchange.com/
instead ofhttps://me.yahoo.com/
and you've got StackExchange login support.