web api authentication and authorization

20
CHALERMPON AREEPONG Microsoft MVP ASP.NET MVCRocks.NET Community and https://fb.com/groups/mvcthaidev Founder DevRock #01 Hello New Year 2015

Upload: chalermpon-areepong

Post on 15-Jul-2015

103 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Web API authentication and authorization

CHALERMPON AREEPONG

Microsoft MVP ASP.NET

MVCRocks.NET Community and https://fb.com/groups/mvcthaidev Founder

DevRock #01 Hello New Year 2015

Page 2: Web API authentication and authorization

DevRock #01 Hello New Year 2015

CHALERMPON AREEPONG

Microsoft MVP – ASP.NET 9 Years

Page 3: Web API authentication and authorization

DevRock #01 Hello New Year 2015

ASP.NET Web APIs

The ways to secure your Web APIs.

Web Security Scenarios

Explain each scenarios

demo

How to

Summaries

Page 4: Web API authentication and authorization

Basic Understanding ASP.NET WEB APIs

DevRock #01 Hello New Year 2015

Page 5: Web API authentication and authorization

DevRock #01 Hello New Year 2015

Support HTTP Content-Types

json, xml, plain text, …, custom

Client can use HTTP to access the APIs

HTTP Verbs to access resources

GET, POST, PUT, DELETE, etc….

Response HTTP Status Code

20x, 30x, 40x, 50x

Multiple Host Types

IIS, WAS, Windows Service, Console, ..

Extensible and Customizable

Page 6: Web API authentication and authorization

DevRock #01 Hello New Year 2015

DEMO

Page 7: Web API authentication and authorization

DevRock #01 Hello New Year 2015

Web

Mobile

Device

Application

Any Client send HTTP Request

Page 8: Web API authentication and authorization

Basic Understanding Web Security

DevRock #01 Hello New Year 2015

Page 9: Web API authentication and authorization

DevRock #01 Hello New Year 2015

Transport Layer Security

HTTPs Protocol Encryption

Untrusted (Anonymous)

Trusted

Page 10: Web API authentication and authorization

DevRock #01 Hello New Year 2015

Application Layer Security (1)

Authentication

Token-Based

Two-Factors

Intranet (IIS Windows)

LDAP (Active Directory, OpenLDAP)

OAuth, OpenID

Identity Services ( Azure AD Service)

Page 11: Web API authentication and authorization

DevRock #01 Hello New Year 2015

Application Layer Security (2)

Authorization

Role Based

Claims Based

…..

Page 12: Web API authentication and authorization

DevRock #01 Hello New Year 2015

Application Layer Security (3)

Data Encryption

Encryption Algorithms

Page 13: Web API authentication and authorization

ASP.NET Web APIs architecture

DevRock #01 Hello New Year 2015

Page 14: Web API authentication and authorization

DevRock #01 Hello New Year 2015

HOST

OWIN

Web API

MessageHandler

global/per-route

Authentication

Filter

Authorization

Filter

Host/Framework

Independent concerns,

e.g. authentication

Web API cross-cutting

concerns, e.g. CORS

Web API specific

Authentication

internal app level

Authorization

Page 15: Web API authentication and authorization

DevRock #01 Hello New Year 2015

Web APIwith OWIN Adpater

OWIN

ASP.NETwith OWIN Bridge

IIS

Page 16: Web API authentication and authorization

DevRock #01 Hello New Year 2015

Web APIwith OWIN Adpater

OWIN

Process/Host+OWIN Bridge

Page 17: Web API authentication and authorization

DevRock #01 Hello New Year 2015

Scalability of servers: Stateless

Centralize user info

Loosely couplingNo dependency Service

Mobile FriendlyJust keep token for reuse in Native Mobile app.

Page 18: Web API authentication and authorization

DevRock #01 Hello New Year 2015

Username / Password

Get token

Page 19: Web API authentication and authorization

DevRock #01 Hello New Year 2015

ASP.NET WEB API 2.0Self Provider

External Provider

Page 20: Web API authentication and authorization