SlideShare a Scribd company logo
ASP.Net Identity
Marwa Ahmad
Software Developer 1
Content
• 01 | Identity Overview
• 02 | Locally Authenticated Users
• 03 | oAuth and Social Providers
• 04 | Two Factor Authentication
• 05 | Asp.Net Identity with Webapi
• 06 | Identity Tips & Recommendations
2
01 | Identity Overview
• What is Identity ?
• History overview
• Architecture of ASP.NET Identity
• ASP.NET Identity Customization
3
What is Identity?
o Identity is Users, Authentication, Authorization.
It is a claims based system; stores login, roles, claims
o Supports claims, roles, custom data stores, individual database
backed auth, Oauth/OpenId, Organizational –AD,
Azure AD, Single Sign On (SSO), Social Login providers
4
History Overview
Nov 2005 ASP.NET 2.0 – Introducing Membership!
• SQL Server, SQL Express
Oct 2013 ASP.NET Identity v1
• Completely new model
May 2012 Universal Providers (First NuGet)
• SQL CE, Azure, one provider to access all SQL
Mar 2014 ASP.NET Identity v2
• VS 2013 Update 2.
Two factor authN, account lockout,
confirmation, reset, etc
Aug 2012 Simple Membership
• Sourced in Web Pages, came to MVC / Web Forms
Oct 2014 (alpha) ASP.NET 5 – Identity v3
• VS 2013 Update 3.
Changes to work with ASP.NET 5
5
ASP.NET Identity Architecture
o Consists of Managers & Stores
o Managers
o High-level classes; not concerned with how user info
is stored, registering new users, validating credentials
and loading user information
o Ex: SigninManager, RoleManager, UserManager
6
ASP.NET Identity Architecture (cont.)
• Stores
o Deals with DAL; CRUD functionality
o Closely coupled with the persistence mechanism
o By default EF Code First used to create tables
SQL Server
o Implementations available for Azure Table Storage,
RavenDB and MongoDB
7
ASP.NET Identity Architecture (cont.)
8
• Based on Owin & EF
ASP.NET Identity Architecture (cont.)
• EF default implementation of users & roles
9
ASP.NET Identity Customization
• Customize the user store the same applies to role store
10
ASP.NET Identity Customization (cont.)
• Interfaces to implement when customizing user store
11
Content
• 01 | Identity Overview
• 02 | Locally Authenticated Users
• 03 | oAuth and Social Providers
• 04 | Two Factor Authentication
• 05 | Asp.Net Identity with Webapi
• 06 | Identity Tips & Recommendations
12
02 | Locally Authenticated Users
• What are locally authenticated users?
o Uses DB to authenticate; no third party i.e. authentication is on the same server (AspNetUsers table)
• Customizing the SQL database & entities
ApplicationUser : IdentityUser
• Customizing the type of user store
o Create your own UserStore and IdentityUser. RoleStore as well if you want that.
Storage provider custom implementations exist(MySql, Azure Table Storage, RavenDB, etc
13
Content
• 01 | Identity Overview
• 02 | Locally Authenticated Users
• 03 | oAuth and Social Providers
• 04 | Two Factor Authentication
• 05 | Asp.Net Identity with Webapi
• 06 | Identity Tips & Recommendations
14
03 | oAuth and Social Providers
• What is oAuth?
o oAuth is a protocol
o The protocol allows for third party applications to access resources without users giving
credentials to third party
o Supports desktop, web, mobile, etc
• How does Identity use oAuth?
• Integrating with social/other providers
15
03 | oAuth and Social Providers (cont.)
• How does Identity use oAuth?
16
Content
• 01 | Identity Overview
• 02 | Locally Authenticated Users
• 03 | oAuth and Social Providers
• 04 | Two Factor Authentication
• 05 | Asp.Net Identity with Webapi
• 06 | Identity Tips & Recommendations
17
04 | Two Factor Authentication
18
Content
• 01 | Identity Overview
• 02 | Locally Authenticated Users
• 03 | oAuth and Social Providers
• 04 | Two Factor Authentication
• 05 | Asp.Net Identity with Webapi
• 06 | Identity Tips & Recommendations
19
Asp.Net Identity with Webapi
• Webapi2 Security AutheN Bearer Token tutorial; useful video; 2 mins only!
• Works with Framework 4.5, AspNet.Identity.Core 2.2.1, AspNet.Identity.EntityFramework 2.2.1, AspNet.Identity.WebApi
5.2.3
• Steps:
• Create new Webapi project with Individual account authentication type
• Run the project
• Use Fiddler, call the Register endpoint; Ex: http://localhost:8070/api/Account/Register
Request post body: then excute
{"Email": “myemail@gmail.com",
"Password": "Pa$$w0rd",
"ConfirmPassword": "Pa$$w0rd"}
• User fiddler: http://localhost:8070/token
Request body:
username=myemail@gmail.com&grant_type=password&Password=Pa$$w0rd
• Now you are authorized to user any endpoint which requires [Authorize] 20
Asp.Net Identity with Webapi
21
Content
• 01 | Identity Overview
• 02 | Locally Authenticated Users
• 03 | oAuth and Social Providers
• 04 | Two Factor Authentication
• 05 | Asp.Net Identity with Webapi
• 06 | Identity Tips & Recommendations
22
05 | Identity Tips & Recommendations
• Utilize SSL everywhere. Never run without it
o Attacker on network can steal your cookies and hijack your session
o Yes, even login page needs to be protected
o Any page user can access while logged in should be protected
• Enforce a strong password policy!
o Increase default values on manager.PasswordValidator
• Use Xsrf tokens everywhere for post methods
• Do not allow for unlimited login attempts
o Brute forcers dream.
• Two factor authentication highly recommended
• Caution – be wary of email as a second factor authentication
23
Finally
What’s Next?
• ASP.NET vNext (ASP.NET 5) being in development, Katana is slowly getting
retired. Version 3.0 will most likely be last major release of Katana as a standalone
framework
• vNext is the successor to Katana (which is why they look so similar). Katana was
the beginning of the break away from System.Web and to more modular
components for the web stack. You can see vNext as a continuation of that work
plus (new CLR, new Project System, new http abstractions)* David Fowler vNext
Architect
• Everything that exists today in Katana will make it's way into vNext
• ASP.NET vNext will be supported by .NET Framework 4.6
24
References
• Customizing asp.net authentication with Identity
• Securing web applications using asp.net identity
• Introduction to asp.net identity
• Creating web project; authentication modes
• Overview of custom storage provider of asp.net identity
• Asp.net identity releases
• Owin & Katana simplified
• Individual accounts in Webapi
• AspNet Identity 2.1 with AspNet WebApi 2.2; Accounts managemenet
• AspNet Identity 2.0 & WebApi- Customizing Identity Models & implementing Role-based Authorization
25
26

More Related Content

What's hot

Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1
Vinu Gunasekaran
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
Serhat Can
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
07.pallav
 
OAuth2 + API Security
OAuth2 + API SecurityOAuth2 + API Security
OAuth2 + API Security
Amila Paranawithana
 
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014
JWORKS powered by Ordina
 
SAML / OpenID Connect / OAuth / SCIM 技術解説 - ID&IT 2014 #idit2014
SAML / OpenID Connect / OAuth / SCIM 技術解説  - ID&IT 2014 #idit2014SAML / OpenID Connect / OAuth / SCIM 技術解説  - ID&IT 2014 #idit2014
SAML / OpenID Connect / OAuth / SCIM 技術解説 - ID&IT 2014 #idit2014Nov Matake
 
Vue.js
Vue.jsVue.js
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
Amazon Web Services
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare
SaleemMalik52
 
Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
Amit Baghel
 
Dependency injection ppt
Dependency injection pptDependency injection ppt
Dependency injection ppt
Swati Srivastava
 
Server side scripting
Server side scriptingServer side scripting
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplate
Guo Albert
 
Introduction to SAML 2.0
Introduction to SAML 2.0Introduction to SAML 2.0
Introduction to SAML 2.0
Mika Koivisto
 
Do we need SOLID principles during software development?
Do we need SOLID principles during software development?Do we need SOLID principles during software development?
Do we need SOLID principles during software development?
Anna Shymchenko
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jaydeep Kale
 
Swagger / Quick Start Guide
Swagger / Quick Start GuideSwagger / Quick Start Guide
Swagger / Quick Start Guide
Andrii Gakhov
 
SAML Protocol Overview
SAML Protocol OverviewSAML Protocol Overview
SAML Protocol Overview
Mike Schwartz
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
Eberhard Wolff
 
Scim overview
Scim overviewScim overview
Scim overview
Morteza Ansari
 

What's hot (20)

Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1Azure AD B2C Webinar Series: Custom Policies Part 1
Azure AD B2C Webinar Series: Custom Policies Part 1
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Spring Boot and REST API
Spring Boot and REST APISpring Boot and REST API
Spring Boot and REST API
 
OAuth2 + API Security
OAuth2 + API SecurityOAuth2 + API Security
OAuth2 + API Security
 
Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014Documenting your REST API with Swagger - JOIN 2014
Documenting your REST API with Swagger - JOIN 2014
 
SAML / OpenID Connect / OAuth / SCIM 技術解説 - ID&IT 2014 #idit2014
SAML / OpenID Connect / OAuth / SCIM 技術解説  - ID&IT 2014 #idit2014SAML / OpenID Connect / OAuth / SCIM 技術解説  - ID&IT 2014 #idit2014
SAML / OpenID Connect / OAuth / SCIM 技術解説 - ID&IT 2014 #idit2014
 
Vue.js
Vue.jsVue.js
Vue.js
 
Architecture: Microservices
Architecture: MicroservicesArchitecture: Microservices
Architecture: Microservices
 
Angular kickstart slideshare
Angular kickstart   slideshareAngular kickstart   slideshare
Angular kickstart slideshare
 
Angularjs PPT
Angularjs PPTAngularjs PPT
Angularjs PPT
 
Dependency injection ppt
Dependency injection pptDependency injection ppt
Dependency injection ppt
 
Server side scripting
Server side scriptingServer side scripting
Server side scripting
 
Spring JDBCTemplate
Spring JDBCTemplateSpring JDBCTemplate
Spring JDBCTemplate
 
Introduction to SAML 2.0
Introduction to SAML 2.0Introduction to SAML 2.0
Introduction to SAML 2.0
 
Do we need SOLID principles during software development?
Do we need SOLID principles during software development?Do we need SOLID principles during software development?
Do we need SOLID principles during software development?
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
Swagger / Quick Start Guide
Swagger / Quick Start GuideSwagger / Quick Start Guide
Swagger / Quick Start Guide
 
SAML Protocol Overview
SAML Protocol OverviewSAML Protocol Overview
SAML Protocol Overview
 
Microservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring CloudMicroservices with Java, Spring Boot and Spring Cloud
Microservices with Java, Spring Boot and Spring Cloud
 
Scim overview
Scim overviewScim overview
Scim overview
 

Viewers also liked

Microsoft asp.net identity security
Microsoft asp.net identity  securityMicrosoft asp.net identity  security
Microsoft asp.net identity security
rustd
 
ASP.NET Identity - O Novo componente de Membership do ASP.NET
ASP.NET Identity - O Novo componente de Membership do ASP.NETASP.NET Identity - O Novo componente de Membership do ASP.NET
ASP.NET Identity - O Novo componente de Membership do ASP.NET
Eduardo Pires
 
Asp.net identity dot netconf
Asp.net identity dot netconfAsp.net identity dot netconf
Asp.net identity dot netconf
rustd
 
Asp.net identity overview
Asp.net identity overviewAsp.net identity overview
Asp.net identity overview功豪 魏
 
Asp.Net Mvc 5 Identity
Asp.Net Mvc 5 IdentityAsp.Net Mvc 5 Identity
Asp.Net Mvc 5 Identity
Ünal Ün
 
What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014
Derek Smith
 
Bring your own authentication to mvc
Bring your own authentication to mvcBring your own authentication to mvc
Bring your own authentication to mvc
Shayne Boyer
 

Viewers also liked (7)

Microsoft asp.net identity security
Microsoft asp.net identity  securityMicrosoft asp.net identity  security
Microsoft asp.net identity security
 
ASP.NET Identity - O Novo componente de Membership do ASP.NET
ASP.NET Identity - O Novo componente de Membership do ASP.NETASP.NET Identity - O Novo componente de Membership do ASP.NET
ASP.NET Identity - O Novo componente de Membership do ASP.NET
 
Asp.net identity dot netconf
Asp.net identity dot netconfAsp.net identity dot netconf
Asp.net identity dot netconf
 
Asp.net identity overview
Asp.net identity overviewAsp.net identity overview
Asp.net identity overview
 
Asp.Net Mvc 5 Identity
Asp.Net Mvc 5 IdentityAsp.Net Mvc 5 Identity
Asp.Net Mvc 5 Identity
 
What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014What's New in ASP.NET Identity - TRINUG Sept 2014
What's New in ASP.NET Identity - TRINUG Sept 2014
 
Bring your own authentication to mvc
Bring your own authentication to mvcBring your own authentication to mvc
Bring your own authentication to mvc
 

Similar to Asp.Net Identity

SharePoint Saturday Utah - Do you claim to be from the Azure Sky?
SharePoint Saturday Utah - Do you claim to be from the Azure Sky?SharePoint Saturday Utah - Do you claim to be from the Azure Sky?
SharePoint Saturday Utah - Do you claim to be from the Azure Sky?
Liam Cleary [MVP]
 
Aws
AwsAws
Sharepoint server 2013 training
Sharepoint server  2013 trainingSharepoint server  2013 training
Sharepoint server 2013 training
FuturePoint Technologies
 
ASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So FarASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So Far
Lohith Goudagere Nagaraj
 
Developer’s Independence Day: Introducing the SharePoint App Model
Developer’s Independence Day:Introducing the SharePoint App ModelDeveloper’s Independence Day:Introducing the SharePoint App Model
Developer’s Independence Day: Introducing the SharePoint App Model
bgerman
 
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
O365Con18 - Hybrid SharePoint Deep Dive - Thomas VochtenO365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
NCCOMMS
 
Understanding SharePoint Apps, authentication and authorization infrastructur...
Understanding SharePoint Apps, authentication and authorization infrastructur...Understanding SharePoint Apps, authentication and authorization infrastructur...
Understanding SharePoint Apps, authentication and authorization infrastructur...
SPC Adriatics
 
Building IAM for OpenStack
Building IAM for OpenStackBuilding IAM for OpenStack
Building IAM for OpenStack
Steve Martinelli
 
Aws sys ops administrator
Aws sys ops administratorAws sys ops administrator
Aws sys ops administrator
Learntek1
 
Sitecore - what to look forward to
Sitecore - what to look forward toSitecore - what to look forward to
Sitecore - what to look forward to
jinto77
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?
Talbott Crowell
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API Management
Callon Campbell
 
Brewing Beer with Windows Azure - ASPConf
Brewing Beer with Windows Azure - ASPConfBrewing Beer with Windows Azure - ASPConf
Brewing Beer with Windows Azure - ASPConf
Maarten Balliauw
 
SharePoint 2013 App or Not to App
SharePoint 2013 App or Not to AppSharePoint 2013 App or Not to App
SharePoint 2013 App or Not to App
Kenneth Maglio
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Sirwan Afifi
 
Microsoft certified azure developer associate
Microsoft certified azure developer associateMicrosoft certified azure developer associate
Microsoft certified azure developer associate
Gaurav Singh
 
Amit Kumar Architect with Web and Angular JS
Amit Kumar Architect with Web and Angular JSAmit Kumar Architect with Web and Angular JS
Amit Kumar Architect with Web and Angular JS
Amit Kumar
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
Yochay Kiriaty
 
Integrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchIntegrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio Lightswitch
Rob Windsor
 
05 entity framework
05 entity framework05 entity framework
05 entity framework
Bat Programmer
 

Similar to Asp.Net Identity (20)

SharePoint Saturday Utah - Do you claim to be from the Azure Sky?
SharePoint Saturday Utah - Do you claim to be from the Azure Sky?SharePoint Saturday Utah - Do you claim to be from the Azure Sky?
SharePoint Saturday Utah - Do you claim to be from the Azure Sky?
 
Aws
AwsAws
Aws
 
Sharepoint server 2013 training
Sharepoint server  2013 trainingSharepoint server  2013 training
Sharepoint server 2013 training
 
ASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So FarASP.NET MVC - Latest & Greatest So Far
ASP.NET MVC - Latest & Greatest So Far
 
Developer’s Independence Day: Introducing the SharePoint App Model
Developer’s Independence Day:Introducing the SharePoint App ModelDeveloper’s Independence Day:Introducing the SharePoint App Model
Developer’s Independence Day: Introducing the SharePoint App Model
 
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
O365Con18 - Hybrid SharePoint Deep Dive - Thomas VochtenO365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
O365Con18 - Hybrid SharePoint Deep Dive - Thomas Vochten
 
Understanding SharePoint Apps, authentication and authorization infrastructur...
Understanding SharePoint Apps, authentication and authorization infrastructur...Understanding SharePoint Apps, authentication and authorization infrastructur...
Understanding SharePoint Apps, authentication and authorization infrastructur...
 
Building IAM for OpenStack
Building IAM for OpenStackBuilding IAM for OpenStack
Building IAM for OpenStack
 
Aws sys ops administrator
Aws sys ops administratorAws sys ops administrator
Aws sys ops administrator
 
Sitecore - what to look forward to
Sitecore - what to look forward toSitecore - what to look forward to
Sitecore - what to look forward to
 
Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?Custom Development in SharePoint – What are my options now?
Custom Development in SharePoint – What are my options now?
 
Exposing services with Azure API Management
Exposing services with Azure API ManagementExposing services with Azure API Management
Exposing services with Azure API Management
 
Brewing Beer with Windows Azure - ASPConf
Brewing Beer with Windows Azure - ASPConfBrewing Beer with Windows Azure - ASPConf
Brewing Beer with Windows Azure - ASPConf
 
SharePoint 2013 App or Not to App
SharePoint 2013 App or Not to AppSharePoint 2013 App or Not to App
SharePoint 2013 App or Not to App
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Microsoft certified azure developer associate
Microsoft certified azure developer associateMicrosoft certified azure developer associate
Microsoft certified azure developer associate
 
Amit Kumar Architect with Web and Angular JS
Amit Kumar Architect with Web and Angular JSAmit Kumar Architect with Web and Angular JS
Amit Kumar Architect with Web and Angular JS
 
Azure Functions Real World Examples
Azure Functions Real World Examples Azure Functions Real World Examples
Azure Functions Real World Examples
 
Integrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio LightswitchIntegrating SharePoint 2010 and Visual Studio Lightswitch
Integrating SharePoint 2010 and Visual Studio Lightswitch
 
05 entity framework
05 entity framework05 entity framework
05 entity framework
 

Recently uploaded

Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
Gerardo Pardo-Castellote
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
Alina Yurenko
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Łukasz Chruściel
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
rodomar2
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
Octavian Nadolu
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
kalichargn70th171
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
Green Software Development
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
Hironori Washizaki
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
Hornet Dynamics
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
SOCRadar
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 

Recently uploaded (20)

Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
DDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systemsDDS-Security 1.2 - What's New? Stronger security for long-running systems
DDS-Security 1.2 - What's New? Stronger security for long-running systems
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)GOING AOT WITH GRAALVM FOR  SPRING BOOT (SPRING IO)
GOING AOT WITH GRAALVM FOR SPRING BOOT (SPRING IO)
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️Need for Speed: Removing speed bumps from your Symfony projects ⚡️
Need for Speed: Removing speed bumps from your Symfony projects ⚡️
 
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CDKuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
KuberTENes Birthday Bash Guadalajara - Introducción a Argo CD
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Artificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension FunctionsArtificia Intellicence and XPath Extension Functions
Artificia Intellicence and XPath Extension Functions
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
Why Mobile App Regression Testing is Critical for Sustained Success_ A Detail...
 
GreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-JurisicGreenCode-A-VSCode-Plugin--Dario-Jurisic
GreenCode-A-VSCode-Plugin--Dario-Jurisic
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 
SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024SWEBOK and Education at FUSE Okinawa 2024
SWEBOK and Education at FUSE Okinawa 2024
 
E-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet DynamicsE-commerce Development Services- Hornet Dynamics
E-commerce Development Services- Hornet Dynamics
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 
socradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdfsocradar-q1-2024-aviation-industry-report.pdf
socradar-q1-2024-aviation-industry-report.pdf
 
How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 

Asp.Net Identity

  • 2. Content • 01 | Identity Overview • 02 | Locally Authenticated Users • 03 | oAuth and Social Providers • 04 | Two Factor Authentication • 05 | Asp.Net Identity with Webapi • 06 | Identity Tips & Recommendations 2
  • 3. 01 | Identity Overview • What is Identity ? • History overview • Architecture of ASP.NET Identity • ASP.NET Identity Customization 3
  • 4. What is Identity? o Identity is Users, Authentication, Authorization. It is a claims based system; stores login, roles, claims o Supports claims, roles, custom data stores, individual database backed auth, Oauth/OpenId, Organizational –AD, Azure AD, Single Sign On (SSO), Social Login providers 4
  • 5. History Overview Nov 2005 ASP.NET 2.0 – Introducing Membership! • SQL Server, SQL Express Oct 2013 ASP.NET Identity v1 • Completely new model May 2012 Universal Providers (First NuGet) • SQL CE, Azure, one provider to access all SQL Mar 2014 ASP.NET Identity v2 • VS 2013 Update 2. Two factor authN, account lockout, confirmation, reset, etc Aug 2012 Simple Membership • Sourced in Web Pages, came to MVC / Web Forms Oct 2014 (alpha) ASP.NET 5 – Identity v3 • VS 2013 Update 3. Changes to work with ASP.NET 5 5
  • 6. ASP.NET Identity Architecture o Consists of Managers & Stores o Managers o High-level classes; not concerned with how user info is stored, registering new users, validating credentials and loading user information o Ex: SigninManager, RoleManager, UserManager 6
  • 7. ASP.NET Identity Architecture (cont.) • Stores o Deals with DAL; CRUD functionality o Closely coupled with the persistence mechanism o By default EF Code First used to create tables SQL Server o Implementations available for Azure Table Storage, RavenDB and MongoDB 7
  • 8. ASP.NET Identity Architecture (cont.) 8 • Based on Owin & EF
  • 9. ASP.NET Identity Architecture (cont.) • EF default implementation of users & roles 9
  • 10. ASP.NET Identity Customization • Customize the user store the same applies to role store 10
  • 11. ASP.NET Identity Customization (cont.) • Interfaces to implement when customizing user store 11
  • 12. Content • 01 | Identity Overview • 02 | Locally Authenticated Users • 03 | oAuth and Social Providers • 04 | Two Factor Authentication • 05 | Asp.Net Identity with Webapi • 06 | Identity Tips & Recommendations 12
  • 13. 02 | Locally Authenticated Users • What are locally authenticated users? o Uses DB to authenticate; no third party i.e. authentication is on the same server (AspNetUsers table) • Customizing the SQL database & entities ApplicationUser : IdentityUser • Customizing the type of user store o Create your own UserStore and IdentityUser. RoleStore as well if you want that. Storage provider custom implementations exist(MySql, Azure Table Storage, RavenDB, etc 13
  • 14. Content • 01 | Identity Overview • 02 | Locally Authenticated Users • 03 | oAuth and Social Providers • 04 | Two Factor Authentication • 05 | Asp.Net Identity with Webapi • 06 | Identity Tips & Recommendations 14
  • 15. 03 | oAuth and Social Providers • What is oAuth? o oAuth is a protocol o The protocol allows for third party applications to access resources without users giving credentials to third party o Supports desktop, web, mobile, etc • How does Identity use oAuth? • Integrating with social/other providers 15
  • 16. 03 | oAuth and Social Providers (cont.) • How does Identity use oAuth? 16
  • 17. Content • 01 | Identity Overview • 02 | Locally Authenticated Users • 03 | oAuth and Social Providers • 04 | Two Factor Authentication • 05 | Asp.Net Identity with Webapi • 06 | Identity Tips & Recommendations 17
  • 18. 04 | Two Factor Authentication 18
  • 19. Content • 01 | Identity Overview • 02 | Locally Authenticated Users • 03 | oAuth and Social Providers • 04 | Two Factor Authentication • 05 | Asp.Net Identity with Webapi • 06 | Identity Tips & Recommendations 19
  • 20. Asp.Net Identity with Webapi • Webapi2 Security AutheN Bearer Token tutorial; useful video; 2 mins only! • Works with Framework 4.5, AspNet.Identity.Core 2.2.1, AspNet.Identity.EntityFramework 2.2.1, AspNet.Identity.WebApi 5.2.3 • Steps: • Create new Webapi project with Individual account authentication type • Run the project • Use Fiddler, call the Register endpoint; Ex: http://localhost:8070/api/Account/Register Request post body: then excute {"Email": “myemail@gmail.com", "Password": "Pa$$w0rd", "ConfirmPassword": "Pa$$w0rd"} • User fiddler: http://localhost:8070/token Request body: username=myemail@gmail.com&grant_type=password&Password=Pa$$w0rd • Now you are authorized to user any endpoint which requires [Authorize] 20
  • 22. Content • 01 | Identity Overview • 02 | Locally Authenticated Users • 03 | oAuth and Social Providers • 04 | Two Factor Authentication • 05 | Asp.Net Identity with Webapi • 06 | Identity Tips & Recommendations 22
  • 23. 05 | Identity Tips & Recommendations • Utilize SSL everywhere. Never run without it o Attacker on network can steal your cookies and hijack your session o Yes, even login page needs to be protected o Any page user can access while logged in should be protected • Enforce a strong password policy! o Increase default values on manager.PasswordValidator • Use Xsrf tokens everywhere for post methods • Do not allow for unlimited login attempts o Brute forcers dream. • Two factor authentication highly recommended • Caution – be wary of email as a second factor authentication 23
  • 24. Finally What’s Next? • ASP.NET vNext (ASP.NET 5) being in development, Katana is slowly getting retired. Version 3.0 will most likely be last major release of Katana as a standalone framework • vNext is the successor to Katana (which is why they look so similar). Katana was the beginning of the break away from System.Web and to more modular components for the web stack. You can see vNext as a continuation of that work plus (new CLR, new Project System, new http abstractions)* David Fowler vNext Architect • Everything that exists today in Katana will make it's way into vNext • ASP.NET vNext will be supported by .NET Framework 4.6 24
  • 25. References • Customizing asp.net authentication with Identity • Securing web applications using asp.net identity • Introduction to asp.net identity • Creating web project; authentication modes • Overview of custom storage provider of asp.net identity • Asp.net identity releases • Owin & Katana simplified • Individual accounts in Webapi • AspNet Identity 2.1 with AspNet WebApi 2.2; Accounts managemenet • AspNet Identity 2.0 & WebApi- Customizing Identity Models & implementing Role-based Authorization 25
  • 26. 26

Editor's Notes

  1. *Claims: Key-Value pair per user; Role is single value “Admin” Much more info about user as the user delivers claim to your app Ex “Facebook Access Token”, “CAAVl6UvghVkBAIGZB… *Single Sign On (SSO): User provides same credentials  multiple services. User provides credentials once  multiple services.
  2. IdentityUser an EF implementation, EmailService, SmsService (twilio sms)
  3. OWIN itself does not have any tools, libraries or anything else. It is just a specification. OWIN is not a framework. OWIN is a specification on how web servers and web applications should be built in order to decouple one from another and allow movement of ASP.NET applications to environments where at the current state it is not possible.
  4. public class IdentityUser : IUser<int> { public IdentityUser() { ... } public IdentityUser(string userName) { ... } public int Id { get; set; } public string UserName { get; set; } // can also define optional properties such as: // PasswordHash // SecurityStamp // Claims // Logins // Roles } public class UserStore : IUserStore<IdentityUser, int> { public UserStore() { ... } public UserStore(ExampleStorage database) { ... } public Task CreateAsync(IdentityUser user) { ... } public Task DeleteAsync(IdentityUser user) { ... } public Task<IdentityUser> FindByIdAsync(int userId) { ... } public Task<IdentityUser> FindByNameAsync(string userName) { ... } public Task UpdateAsync(IdentityUser user) { ... } public void Dispose() { ... } }
  5. *Reconfigure application to use new storage provider : Replace default storage provider in MVC project http://www.asp.net/identity/overview/extensibility/overview-of-custom-storage-providers-for-aspnet-identity
  6. Several custom implementations exist for storage providers ASP.NET Identity Recommended Resources Overview of Custom Storage Providers for ASP.NET Identity
  7. Integrating with social/other providers (Demo + ..) Works with oAuth 2.0 We’re making the OpenIDConnect middleware more generic to support more providers We’ve added a generic OAuth2 middleware that works with many different providers https://github.com/aspnet/Security/blob/dev/samples/SocialSample/Startup.cs#L116
  8. AspNetUserLogin table Tracks provider name Tokens are not stored Your app requests a request token, gets one and URL User goes to URL (with token) and authenticates & allows app oAuth provider redirects back to your ‘success’ page with Your code parses access token, potentially stores it If user doesn’t have an account, prompt them to register with email (so we have something on hand). We could change code to auto create. All requests to protected resources are done with access token that is stored in AspNetUserClaims
  9. *totp: Time-based One-time Password Algorithm is an algorithm that computes a one-time password from a shared secret key and the current time. When developing remember… Adding the phone number triggers the first verification No phone #? SmsService code will never be called Debug – you may not have all the code you need Email will only be available if it’s verified
  10. Identity is not multi-tenant or multi-app Use SSO with Azure for multi tenant https://github.com/AzureADSamples/WebApp-MultiTenant-OpenIdConnect-DotNet Shared across apps via shared sql db with identity tables **It’s extensible** AspNet.Identity.EntityFramework.Multitenant on github
  11. ASP.NET vNext will be built on top of .NET Core 5. .NET Core 5 is lightweight factored version of .NET Framework, designed to support goals of ASP.NET 5 and .NET Native.