Logo

Maarten Balliauw {blog}

ASP.NET, ASP.NET MVC, Windows Azure, PHP, ...

About the author

Maarten Balliauw is currently employed as a Technical Evangelist at JetBrains. His interests are mainly web applications developed in ASP.NET (C#) or PHP and the Windows Azure cloud platform.
More about me More about me
Send mail E-mail me


ASP.NET MVC Quickly Pro NuGet Subscribe to my RSS feed Follow me on Twitter! View Maarten Balliauw's profile on LinkedIn
Maarten Balliauw - MVP - Most Valuable Professional
Maarten Balliauw - ASPInsider

Search

Archive

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright Maarten Balliauw 2013


ASP.Net MVC Membership Starter Kit alternative authentication

Last week, I blogged about the ASP.Net MVC Membership Starter Kit and some of its features. Since then, Troy Goode and I are developing at warp-speed to provide a complete (Forms)Authentication starter kit for the MVC framework. Scott Guthrie also noticed our efforts, which forced us to do an official release earlier than planned.

Now when I say warp-speed, here's what to think of: we added Visual Studio item templates, a nice setup program, a demo application, ... We started with FormsAuthentication, but we have evolved into some alternatives...

OpenID authentication

You can add a route to the OpenID login action, and have an out-of-the box OpenID login form:

OpenID login

Simply enter your OpenID URL, click login. The MVC Membership Starter Kit will handle the rest for you!

More on this lightweight OpenID consumer from Mads Kristensen.

Windows Live ID authentication

For this, you'll need an application key. If you have one, you can add a route to the Windows Live ID login action, and have an out-of-the box Windows Live ID login form:

WLL login

Simply click the "Sign in" link. You will then be authenticated via Windows Live ID Web Authentication and returned to your ASP.Net MVC application when the authentication succeeds. The MVC Membership Starter Kit will handle all background processing for you!

WLL login

WLL login

More on Windows Live ID Web Authentication at dev.live.com.

Associate user with membership database

Both the OpenID and Windows Live ID authentication require you to do one "manual" step: implement the link between the membership database and the authentication method. You can simply override a virtual method in your own controller implementation, like so:

protected override MembershipUser AssociateOpenIDToMembershipUser( string identity, string name, string email )
{
    // TODO: implement this to use OpenID authentication
    return null;
}

protected override MembershipUser AssociateWindowsLiveIDToMembershipUser(string userId)
{
    // TODO: implement this to use Windows Live ID authentication
    return null;
}

What you'll have to do is return the ASP.Net membership user associated with the OpenID / Windows Live ID account.

The Windows Live ID authentication is currently only available from source control on CodePlex.

(by the way: I think this is the first OpenID and Windows Live ID implementation ever using the ASP.Net MVC framework)

kick it on DotNetKicks.com


Categories: ASP.NET | C# | General | MVC | Projects

Comments (1) -

Troy Goode United States |

Tuesday, April 15, 2008 3:39 PM

Troy Goode

Nicely done Maarten! More options for everyone. =)

Pingbacks and trackbacks (4)+

Comments are closed