high-level api for single sign on using saml

31
High-level API for Single Sign On using SAML Tony Ngan

Upload: tony-ngan

Post on 09-Jan-2017

928 views

Category:

Software


2 download

TRANSCRIPT

Page 1: High-level API for Single Sign On using SAML

High-level API for Single Sign On using SAML

Tony Ngan

Page 2: High-level API for Single Sign On using SAML

$ whoami

Tony Ngan (tngan)

Currently MSc(CompSc) student @HKUGraduated @CUHK IEWorked as software engineer for 2 yearsEmbrace open source projectsLove coding

#NodeJS #ES6 #JavaScript #CSharp #ReactJS #Redux #Flux #MongoDB #SQL #SAML2 #HTML #Webpack #MVC #Gulp #JQuery #C #Rails #GraphQL #SSO #Git #SVN

@Siaoyoukeng, Taipei 2015

Page 3: High-level API for Single Sign On using SAML

Agenda

A dummy guide to Single Sign On- Introduction- Implementation

Overview of express-saml2- Introduction- Short Demo (You guys always love it)- What is the next ?

Mobile implementation using OAuth (Ronghai)

Page 4: High-level API for Single Sign On using SAML

SSO, huh !?

Single sign-on (SSO) is a property of access control of multiple related, but independent software systems.

(Wikipedia)

Page 5: High-level API for Single Sign On using SAML

SSO, huh !?

Let’s imagine …

Difficult to manage their account/password

Page 6: High-level API for Single Sign On using SAML

SSO, huh !?

Using SSO …

Only need to remember one set credential

Page 7: High-level API for Single Sign On using SAML

Special Use Case

Used to manage access control

Only manager-level users can login to the internal systems, but we want to give limited privilege to some employees to use the internal systems, how can we do it ?

Page 8: High-level API for Single Sign On using SAML

Special Use Case

Used to manage access control

An account is created in the Identity Provider for each employee. They can only login via SSO as a SSO user to get access right in the system.

Page 9: High-level API for Single Sign On using SAML

How to implement ?

SAMLBased on XML assertion

Adopted widely in Web based applications

Open-ID ConnectBased on OAuth token

Applied in mobile applications

Page 10: High-level API for Single Sign On using SAML

Behind SAML SSO

Three parties we used to explain

Page 11: High-level API for Single Sign On using SAML

Behind SAML SSO

Users/ClientsTake action to access the applications

Memorize one set of credential

Page 12: High-level API for Single Sign On using SAML

Behind SAML SSO

Identity ProviderAn entity authenticates the users

Page 13: High-level API for Single Sign On using SAML

Behind SAML SSO

Service ProviderAn entity provides services/resources

Page 14: High-level API for Single Sign On using SAML

Go through SAML SSO

Example: Service Provider Initiated SSOAnother: Identity Provider Initiated SSO

Page 15: High-level API for Single Sign On using SAML

Step 1

User types the URL of the Service Provider for SSO

Page 16: High-level API for Single Sign On using SAML

Step 2

Service Provider sends a SAML Request to Identity Provider to get

User’s authenticity.

Page 17: High-level API for Single Sign On using SAML

What is SAML Request ?

Tells Identity Provider that ‘I want you to authenticate the user’

Page 18: High-level API for Single Sign On using SAML

Step 3

User now logins to Identity Provider to authenticate himself

Page 19: High-level API for Single Sign On using SAML

Step 4

Identity Provider sends back a SAML Response to Service Provider and confirm the user authenticity.

Page 20: High-level API for Single Sign On using SAML

What is SAML Response?

Page 21: High-level API for Single Sign On using SAML

Step 5

Finally Service Provider prepares a session for user and logged into the

application

Page 22: High-level API for Single Sign On using SAML

More security options

- Signature is used in request and response to achieve non-repudiation

- Set expired date in SAML response- Encryption of sensitive information in SAML

response- Request is paired up with Response- HTTPS connection to provide transport layer

encryption- Data integrity

Page 23: High-level API for Single Sign On using SAML

express-saml2

This module provides high-level API for scalable Single Sign On (SSO) implementation. Developers can easily configure the Service Providers and Identity Providers by importing the corresponding metadata. SAML2.0 provides a standard guide but leaves a lot of options, so we provide a simple interface that's highly configurable.

Page 24: High-level API for Single Sign On using SAML

metadata ?

Metadata is a XML document which specifies entity preference. For example:

- Endpoint of single sign on

- Expect request/response with a signature

- Support bindings of request/response (GET/POST)

- X.509 Certificate used for signature and verification

… etc

Page 25: High-level API for Single Sign On using SAML

Why I build it ?

- Takes me about 2-3 weeks to release the first version

- Developers needs more and more concrete examples

- Flatten the learning curve of SAML standard

- Log the work I’ve done before

- Build an enterprise-level module

- Standardize the coding using same terminology

- Code for FUN !

Page 26: High-level API for Single Sign On using SAML

Abstractions and Design

Abstracted Service Provider and Identity Provider

- Common actions are described in Entity.js e.g. Parse/Export metadata, actions for logout

Abstracted SP Metadata and IdP Metadata

- Common methods are described in Metadata.js

e.g. Get certificate, endpoint for login/logout

Page 27: High-level API for Single Sign On using SAML

Abstractions and Design

Other files:

RedirectBinding.js:: Declare the functions using Redirect binding

PostBinding.js:: Declare the functions using Post binding

urn.js:: Includes all keywords needed

SamlLib.js / Utility.js:: Library for some common functions

Page 28: High-level API for Single Sign On using SAML

Why High-Level ?

Less code and save time !

Page 29: High-level API for Single Sign On using SAML

Quick demo

Page 30: High-level API for Single Sign On using SAML

next( );

- More use cases and examples

- More testing cases (mocha)

- Support more signature algorithms

- A new branch is created to write in ES6 syntax

- Separate out the high-level XML attribute extractor

- Continuous code refactoring

- Reduce dependencies

Feel free to fork and contribute !

Page 31: High-level API for Single Sign On using SAML

Thank You !This PowerPoint will be uploaded to slideshare later on

Thanks Open Source

#Atom #Roboto #icon8/flat-color-icons #express-saml2