integrating oauth2 & openid connect - intersystems · 2018-06-26 · o %oauth2 o api classes,...

21
© 2016 InterSystems Corporation. All rights reserved. Integrating OAuth2 & OpenID Connect

Upload: others

Post on 06-Jul-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

© 2016 InterSystems Corporation. All rights reserved.

Integrating OAuth2 & OpenID Connect

Page 2: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

1 | © 2016 InterSystems Corporation. All Rights Reserved.

Authentication vs Autorization

OpenID Connect

OAuth2

Authentication

Authorization

Who you are

What you can do

Page 3: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

2 | © 2016 InterSystems Corporation. All Rights Reserved.

OAuth is an open standard for authorization, commonly used as a way for Internet users to log into third party websites using their Microsoft, Google, Facebook, Twitter, One Network etc. accounts without exposing their password.Generally, OAuth provides to clients a "secure delegated access" to server resources on behalf of a resource owner. It specifies a process for resource owners to authorize third-party access to their server resources without sharing their credentials. Designed specifically to work with Hypertext Transfer Protocol (HTTP), OAuth essentially allows access tokens to be issued to third-party clients by an authorization server, with the approval of the resource owner. The third party then uses the access token to access the protected resources hosted by the resource server.

What is OAuth?

Page 4: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

3 | © 2016 InterSystems Corporation. All Rights Reserved.

OAuth2 Practical Example

Page 5: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

4 | © 2016 InterSystems Corporation. All Rights Reserved.

Without OAuth2

Page 6: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

5 | © 2016 InterSystems Corporation. All Rights Reserved.

Without OAuth2

Page 7: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

6 | © 2016 InterSystems Corporation. All Rights Reserved.

Without OAuth2

Page 8: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

7 | © 2016 InterSystems Corporation. All Rights Reserved.

Lets Start Again

Page 9: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

8 | © 2016 InterSystems Corporation. All Rights Reserved.

With OAuth2

Page 10: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

9 | © 2016 InterSystems Corporation. All Rights Reserved.

With OAuth2URLchangedto:https://drive.google.com

Page 11: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

10 | © 2016 InterSystems Corporation. All Rights Reserved.

With OAuth2URLis:https://drive.google.com

Page 12: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

11 | © 2016 InterSystems Corporation. All Rights Reserved.

With OAuth2URLchangedtohttp://printfast.comwithcodeparameter

Page 13: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

12 | © 2016 InterSystems Corporation. All Rights Reserved.

With OAuth2

Page 14: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

13 | © 2016 InterSystems Corporation. All Rights Reserved.

OAuth2 Flow in Depth

Page 15: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

14 | © 2016 InterSystems Corporation. All Rights Reserved.

Who is who in OAuth

Person using client application

UserApplication that asks for data from resource server

Client

Registers client and resource server applicationsProvides endpoint for user to login and gain permission to retrieve dataProvides scope

Authorization Server

Resource Server

Provides data to client application through API calls

Resource OwnerA user who is giving access to client

Page 16: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

15 | © 2016 InterSystems Corporation. All Rights Reserved.

OAuth2 Flow - Client RegistrationAuthorization Server

Resource Server

Client Client Registers with Authorization Server

Client_Id=print-fastClient_Secret=xxxRedirect_Url =http://print-fast.com

Page 17: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

16 | © 2016 InterSystems Corporation. All Rights Reserved.

Grant type defines how client application obtains permission (grant) from the users to access their data on their behalf.o Authorization code

o Most often usedo Uses redirect to authorization server to authorize access to data

o Implicit granto Simplified version of the above, the access token is issued directly

o Resource Owner granto Resource owner has to provide its credentials directly to client

o Client Credentials granto Used when client application on behalf of itself, rather than user of client app, is requesting access

to protected resources such as storage or database service

Grant Types/OAuth2 Flows

Page 18: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

17 | © 2016 InterSystems Corporation. All Rights Reserved.

OAuth2 Flow (Authorization code)

Authorization Server

Resource Server

Client

Resource OwnerAuthorization Request

Authorization Grant

Access Token

Authorization Grant

Access Token

Protected Resource

Page 19: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

18 | © 2016 InterSystems Corporation. All Rights Reserved.

o A set of classes in %SYS namespace - framework o Framework classes by their purpose (and package)o %OAuth2

o API classes, provide user customization to authorization page

o Oautho Internal classes used by framework to:

o Store configurationso Store access tokens

o %SYS.OAuth2o API classes, used by developers to:

o Establish OAuth messages flow o Create HTTP request objects

o Validate tokens

How we implement OAuth2

Page 20: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

19 | © 2016 InterSystems Corporation. All Rights Reserved.

Demo

Page 21: Integrating OAuth2 & OpenID Connect - InterSystems · 2018-06-26 · o %OAuth2 o API classes, provide user customization to authorization page o Oauth o Internal classes used by framework

20 | © 2016 InterSystems Corporation. All Rights Reserved.

Where to go from here