40
(#) Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)

Modern Applications need

Modern Security

OpenID Connect & OAuth 2.0

Tuesday, January 29, 2018

12 - 1 PM EST

Page 2: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

• President, Extranet User Manager

• SharePoint MVP

• Partner Seller, Microsoft Canada

[email protected]

• http://blog.petercarson.ca

• www.extranetusermanager.com

• Twitter @carsonpeter

• VP Toronto SharePoint User Group

Peter Carson

Page 3: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

• http://brockallen.com

[email protected]

• Twitter @BrockLAllen

Brock Allen

Page 4: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.cohttp://eum.co

In the Beginning…

Web Applications

Page 5: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.cohttp://eum.co

...then came Federation

Web Applications

SAML, WS-Federation

WS-Trust/Security

Page 6: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

No SOAP

No SAML

No WS*

No Windows

No Enterprise

HTTP

JSON

Then this happened…

Page 7: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Modern Applications

Browser

Native App

Server App"Thing"

Web App

Web API Web API

Web API

Security Token Service

Page 8: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Security Protocols (I)

Browser

Native App

Server App"Thing"

Web App

Web API Web API

Web API

Security Token Service

WS-Fed, SAML 2.0,OpenID Connect*

*

*

Page 9: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Security Protocols (II)

Browser

Native App

Server App"Thing"

Web App

Web API Web API

Web API

Security Token Service

WS-Fed, SAML 2.0,OpenID Connect*

OAuth 2.0

OAuth 2.0

OAuth 2.0

OAuth 2.0

OAuth 2.0

OAuth 2.0

*

*

Page 10: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Craig Burton (#CIS2012):

“SAML is the Windows XP of Identity.”

“No funding. No innovation. People still use it. But it has no future

SAML is dead != SAML is bad. SAML is dead != SAML isn’t useful. SAML is dead means SAML != the future.”

What's wrong with SAML (& WS-Federation)

Page 11: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

What’s wrong with OAuth 2.0

Page 12: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

http://openid.net/connect/

Page 13: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Libraries & Implementations

Page 14: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Page 15: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

IdentityServer

Page 16: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Browser

Native App

Web App

Web API

AuthenticateUsers

Request Access Tokensfor APIs

OpenID Connect in a Nutshell

Page 17: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

AuthorizeEndpoint

TokenEndpoint

Endpoints

Page 18: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

• Implicit/Hybrid/Code Flow

– interactive applications

– user authentication

• Client Credentials Flow

– server to server communication

– headless devices / IoT

Flows

Page 19: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Implicit Flow – Web Applications

GET /authorize

?client_id=app1&redirect_uri=https://app.com/cb&response_type=id_token&response_mode=form_post&nonce=j1y…a23&scope=openid email

Page 20: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Authentication

Page 21: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Consent

Page 22: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

<form><input type="hidden"

name="id_token"value="xjsj…aas" />

</form>

POST /callback

Response

Page 23: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

{"typ": "JWT","alg": "RS256","kid": "mj399j…"

}

{"iss": "https://idsrv3","exp": 1340819380,"aud": "app1","nonce": "d89ui3jk33",

"sub": "182jmm199","email": "[email protected]","email_verified": true,"amr": [ "password" ],"auth_time": 12340819300

}

Header

Claims

eyJhbGciOiJub25lIn0.eyJpc3MiOiJqb2UiLA0KICJleHAiOjEzMD.4MTkzODAsDQogImh0dHA6Ly9leGFt

Header Claims Signature

Identity Token

Page 24: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Discovery

Page 25: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

client identity

user identity

user identity

Accessing APIs

Page 26: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Calling an API using Client Identity

Authorization: Bearer <token>

POST /token

grant_type=client_credentialsscope=api1client_id=clientclient_secret=secret

<token>

Page 27: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

• OpenID Connect Hybrid Flow combines

– user authentication (identity token)

– access to APIs (access token)

• Additional Security Features

– access tokens not exposed to the browser

– (optional) long-lived API access

Web Applications

Page 28: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

GET /authorize

?client_id=app1&redirect_uri=https://app.com/cb&response_type=code id_token&response_mode=form_post&nonce=j1y…a23&scope=openid email api1 api2

Hybrid Flow Request

Page 29: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

POST /cb

<form><input type="hidden"

name="id_token"value="xjsj…aas" />

<input type="hidden"name="code"value="i8j1…jj19" />

</form>

Hybrid Flow Response

Page 30: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

code

(client_id:client_secret)

{access_token: "xyz…123",expires_in: 3600,token_type: "Bearer"

}

• Exchange code for access token

– using client id and secret

Retrieving the Access Token

Page 31: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

• OpenID Connect Code Flow

– Better suited for public clients

– Still obtain id token and access token

• Proof key for code exchange (PKCE)

– Acts as dynamic client secret

– Protects against common attacks

Client-side Applications

Page 32: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

GET /authorize

?client_id=app1&redirect_uri=https://app.com/cb.html&response_type=code&nonce=j1y…a23&scope=openid email api1 api2&code_challenge=x929..1921

Requesting tokens from JavaScript

Page 33: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

GET /callback.html?code=238…823j

Authorize Response

Page 34: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

{id_token: "abc…123",access_token: "xyz…123",expires_in: 3600,token_type: "Bearer"

}

• Aajx used to exchange code for tokens

– using client id and code verifier

Token Endpoint Exchange

client_id, code, code verifier

Page 35: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

GET /authorize

?client_id=native.app&scope=openid email api1 api2 offline_access&redirect_uri=com.mycompany://native.app/cb&response_type=code&code_challenge=x929..1921

Native Applications

Page 36: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

GET com.mycompany://native.app/cb

?code=8128…1299

Response

Page 37: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

client_id, code, code verifier

{id_token: "abc…123",access_token: "xyz…123",refresh_token: "dxy…103"expires_in: 3600,token_type: bearer

}

Token Endpoint Exchange

Page 38: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

• http://openid.net/connect/

• http://openid.net/developers/libraries/

• http://oauth.net/articles/authentication/

• https://github.com/identityserver

• https://github.com/identitymodel

Resources

Page 39: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Upcoming Events

Valo Teamwork and Extranet User ManagerFeb 21, 201912-1 PM EST

eum.co/events

May 21-23, 2019Las Vegas

www.sharepointna.com

Developing Custom Connectors for the Microsoft Power Platform

Feb 28, 201912-1PM EST

eum.co/events

Page 40: Modern Applications need Modern Security · Modern Applications need Modern Security OpenID Connect & OAuth 2.0 Tuesday, January 29, 2018 12 - 1 PM EST

(#)http://eum.co

Thank you!

Questions?

http://eum.co