Who are you? 
Digging into ASP.NET Identity 2.1 
Josh Gillespie
Agenda
What i s an Ident i t y?
What is an Identity? 
• Proof that you are who you say you are. (authentication) 
• The things are you permitted to do. (authorization) 
• Other information we (need to) know about you? (profile)
History of Identity in .NET 
• Forms and Windows Authentication 
• ASP.NET Providers 
• Released with .NET 2.0 (2005) 
• Addressed common site membership requirements 
• ASP.NET Simple Membership 
• Released with VS2010 SP1 
• ASP.NET Universal Providers
ASP.NET Providers 
Pros 
• Simple to setup 
• “Just works” 
Cons 
• Extensibility was hard 
• Testing was hard 
• Other Auth approaches were 
hard 
• Dependent on SQL Server 
• Profile was hard to query 
• Dependent on Forms Auth
ASP.NET Simple Providers 
Pros 
• Profile was improved 
• Easier to add to Web page 
apps 
Cons 
• Non-relational stores are hard 
• Still FormsAuth dependent 
• Not extensible
ASP.NET Universal Providers 
Pros 
• Database was cleaned up 
• Used EF Code First 
• Can use any EF supported 
store 
Cons 
• Built on Membership, same 
limitations
ASP.NET Ident i t y 
Currently 2.1
Goals 
• Useable everywhere (One 
ASP.NET) 
• Easy profile access 
• Persistence agnostic 
• Testable 
• Role-based Authorization 
• Claims-based Authorization 
• Third-party Authentication 
• Azure AD 
• OWIN Integrated 
• NuGet package
So where would you 
s tar t?
Interfaces 
• Entities (IUser, IRole, IClaim, etc) 
• Stores (IUserStore, IRoleStore, etc) 
• Managers 
• Misc supporting classes 
• TokenProviders 
• Validators 
• Factories
Application 
Managers 
Stores 
Data Access Layer 
Data Storage 
Token Providers 
Validators 
Services 
Factories 
Entities
Closer look 
Decompile and look at one “Stack”
Fi le  New Projec t 
What do I get fresh out of the box?
Demo Opt ions 
1. Change the Primary Key 
2. Add a Two-Factor Authenticator Provider
Takeaways 
• When should you use ASP.NET Identity? 
• What is it good for, what is it not good for? 
• Implement only what you need.
Di s cus s ion
Thank you! 
Josh.Gillespie@PolarisSolutions.com 
@jcgillespie 
http://awaitwisdom.com

Who are you?

  • 1.
    Who are you? Digging into ASP.NET Identity 2.1 Josh Gillespie
  • 2.
  • 3.
    What i san Ident i t y?
  • 4.
    What is anIdentity? • Proof that you are who you say you are. (authentication) • The things are you permitted to do. (authorization) • Other information we (need to) know about you? (profile)
  • 5.
    History of Identityin .NET • Forms and Windows Authentication • ASP.NET Providers • Released with .NET 2.0 (2005) • Addressed common site membership requirements • ASP.NET Simple Membership • Released with VS2010 SP1 • ASP.NET Universal Providers
  • 6.
    ASP.NET Providers Pros • Simple to setup • “Just works” Cons • Extensibility was hard • Testing was hard • Other Auth approaches were hard • Dependent on SQL Server • Profile was hard to query • Dependent on Forms Auth
  • 7.
    ASP.NET Simple Providers Pros • Profile was improved • Easier to add to Web page apps Cons • Non-relational stores are hard • Still FormsAuth dependent • Not extensible
  • 8.
    ASP.NET Universal Providers Pros • Database was cleaned up • Used EF Code First • Can use any EF supported store Cons • Built on Membership, same limitations
  • 9.
    ASP.NET Ident it y Currently 2.1
  • 10.
    Goals • Useableeverywhere (One ASP.NET) • Easy profile access • Persistence agnostic • Testable • Role-based Authorization • Claims-based Authorization • Third-party Authentication • Azure AD • OWIN Integrated • NuGet package
  • 11.
    So where wouldyou s tar t?
  • 12.
    Interfaces • Entities(IUser, IRole, IClaim, etc) • Stores (IUserStore, IRoleStore, etc) • Managers • Misc supporting classes • TokenProviders • Validators • Factories
  • 13.
    Application Managers Stores Data Access Layer Data Storage Token Providers Validators Services Factories Entities
  • 14.
    Closer look Decompileand look at one “Stack”
  • 15.
    Fi le New Projec t What do I get fresh out of the box?
  • 16.
    Demo Opt ions 1. Change the Primary Key 2. Add a Two-Factor Authenticator Provider
  • 17.
    Takeaways • Whenshould you use ASP.NET Identity? • What is it good for, what is it not good for? • Implement only what you need.
  • 18.
    Di s cuss ion
  • 19.
    Thank you! Josh.Gillespie@PolarisSolutions.com @jcgillespie http://awaitwisdom.com

Editor's Notes

  • #9 Designed for Azure SQL
  • #15 ID and UserName