Top Banner
Building an SSO platform Ivo Jansch - Egeniq November 4, 2010 - Zendcon
59

Building an SSO platform in php (Zendcon 2010)

Jan 15, 2015

Download

Technology

Ivo Jansch

A presentation explaining how to build Single Sign On functionality in PHP using standards such as OpenID, OAuth and SAML. Delivered on November 4, 2010 at Zendcon in Santa Clara
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Building an SSO platform in php (Zendcon 2010)

Building an SSO platformIvo Jansch - EgeniqNovember 4, 2010 - Zendcon

Page 2: Building an SSO platform in php (Zendcon 2010)

About Egeniq

Startup

Mobile

Tech

Knowledge

Geeks

Development

Page 3: Building an SSO platform in php (Zendcon 2010)

About Me

@ijansch

Developer

Author

Entreprenerd

PHP

Page 4: Building an SSO platform in php (Zendcon 2010)

Single Sign OnWhy do we need it?

Page 5: Building an SSO platform in php (Zendcon 2010)

We use many applications

Your other corporate application

Your corporate application

Page 6: Building an SSO platform in php (Zendcon 2010)

Across devices and locations

Your other corporate application

Your corporate application

Page 7: Building an SSO platform in php (Zendcon 2010)

A quick poll

Page 8: Building an SSO platform in php (Zendcon 2010)

Level 0 - One PasswordTo Rule Them All

Page 9: Building an SSO platform in php (Zendcon 2010)

1 password to rule them all

Your other corporate application

Your corporate application

Page 10: Building an SSO platform in php (Zendcon 2010)

Level 1 - Shared IdentityUsing a single authentication backend for apps

Page 11: Building an SSO platform in php (Zendcon 2010)

Shared Identity

Your other corporate application

Your corporate application

LDAPServer

Page 12: Building an SSO platform in php (Zendcon 2010)

Level 2 - OpenIDUsing OpenID for external Identity Management

Page 13: Building an SSO platform in php (Zendcon 2010)

OpenID Flow

OpenIDConsumer

OpenIDProvider

Page 14: Building an SSO platform in php (Zendcon 2010)

OpenIDConsumer

OpenID Demo

OpenIDProvider

index.php

login.php

consume.php

Page 15: Building an SSO platform in php (Zendcon 2010)

Protecting the secret

Page 16: Building an SSO platform in php (Zendcon 2010)

Delegate to OpenID provider

Page 17: Building an SSO platform in php (Zendcon 2010)

Consume the response

Page 18: Building an SSO platform in php (Zendcon 2010)

Caveats

OpenID providers hesitant to be OpenID consumers

No trust establishment between consumer and provider

Page 19: Building an SSO platform in php (Zendcon 2010)

Level 3 - OAuthUsing OAuth for external IDM and authorization

Page 20: Building an SSO platform in php (Zendcon 2010)

OAuth Flow

OAuthConsumer

OAuthProvider

Page 21: Building an SSO platform in php (Zendcon 2010)

Landing adjusted for OAuth

Page 22: Building an SSO platform in php (Zendcon 2010)

OAuth Configuration

Page 23: Building an SSO platform in php (Zendcon 2010)

Delegate auth to Twitter

Page 24: Building an SSO platform in php (Zendcon 2010)

Consuming the response

Page 25: Building an SSO platform in php (Zendcon 2010)

Level 4 - SAMLCreating our own Identity Provider

Page 26: Building an SSO platform in php (Zendcon 2010)

SAML

Security Assertion Markup Language

XML standard by OASIS

Assertions contain:

Proof of Identity

Attributes

Supports XML signatures and encryption

Page 27: Building an SSO platform in php (Zendcon 2010)

SAML Flow

Service Provider

IdentityProvider

AuthBackend (LDAP, ...)

Page 28: Building an SSO platform in php (Zendcon 2010)

SimpleSAMLphp

Service Provider

Identity Provider

SimpleSAMLPHP

SimpleSAMLPHP

AuthBackend (LDAP, ...)

Page 29: Building an SSO platform in php (Zendcon 2010)

IDP SimpleSAMLphp setup

Page 30: Building an SSO platform in php (Zendcon 2010)

IDP Auth Source Configuration

Page 31: Building an SSO platform in php (Zendcon 2010)

IDP Hosted Configuration

Page 32: Building an SSO platform in php (Zendcon 2010)

IDP Remote Configuration

Page 33: Building an SSO platform in php (Zendcon 2010)

IDP Virtual Host Apache Config

Page 34: Building an SSO platform in php (Zendcon 2010)

Testing the IDP

Page 35: Building an SSO platform in php (Zendcon 2010)

SP SimpleSAMLphp setup

Page 36: Building an SSO platform in php (Zendcon 2010)

SP Auth Source Configuration

Page 37: Building an SSO platform in php (Zendcon 2010)

SP Remote Configuration

Page 38: Building an SSO platform in php (Zendcon 2010)

Back to our landing page

Page 39: Building an SSO platform in php (Zendcon 2010)

Delegate auth to the IDP

Page 40: Building an SSO platform in php (Zendcon 2010)

Integrating 3d party appsSimplesamlphp is easy to integrate

Page 41: Building an SSO platform in php (Zendcon 2010)

WordpressPlugin:

http://wordpress.org/extend/plugins/simplesamlphp-authentication/

Page 42: Building an SSO platform in php (Zendcon 2010)

MediaWikiPlugin:

http://www.mediawiki.org/wiki/Extension:SAMLAuth

Page 43: Building an SSO platform in php (Zendcon 2010)

SugarCRM

Plugin: didn’t work

Problem: auth structure

Solution: hacking the source

Options:

Contact me if you need to get SugarCRM to do SSO :-)

Wait for SugarCRM 6.1, it contains a working SAML plugin (/via @smalyshev)

Page 45: Building an SSO platform in php (Zendcon 2010)

Google Apps

Page 46: Building an SSO platform in php (Zendcon 2010)

Making apps SSO ready

Application

Logged in?

Auth Plugin

Yes

Show Site

LoginForm

Authenticate

Start

No

Page 47: Building an SSO platform in php (Zendcon 2010)

Making apps SSO ready

Application

Logged in?

Auth Plugin

Yes

Show Site

LoginForm

Authenticate

Start

No

Page 48: Building an SSO platform in php (Zendcon 2010)

Making apps SSO ready

Application

Logged in?

Auth Plugin

Yes

Show Site

LoginForm

Authenticate

Start

No

Page 49: Building an SSO platform in php (Zendcon 2010)

Making apps SSO ready

Application

Logged in?

Auth Plugin

Authenticate

Start

No

LoginForm

Show Site

LoginForm

Yes

Page 50: Building an SSO platform in php (Zendcon 2010)

Level 5 - FederationDealing with multiple Identity Providers

Page 51: Building an SSO platform in php (Zendcon 2010)

Federation

Service Provider

AuthenticationFederation

Identity Provider

Identity Provider

Page 52: Building an SSO platform in php (Zendcon 2010)

Confederation

Service Provider

Authentication Federation

Identity Provider

Identity Provider

AuthenticationFederation

Identity Provider

Page 53: Building an SSO platform in php (Zendcon 2010)

Collaboration Infrastructures

http://www.surfnet.nl/en/Thema/coin/Pages/Default.aspx

Page 54: Building an SSO platform in php (Zendcon 2010)

The Future

Page 55: Building an SSO platform in php (Zendcon 2010)

The Future

Page 56: Building an SSO platform in php (Zendcon 2010)

ConclusionWhat should you take away from this talk?

Page 57: Building an SSO platform in php (Zendcon 2010)

In your next project...

You will NOT create more userids !!

You WILL use standard protocols !!

Page 59: Building an SSO platform in php (Zendcon 2010)

CreditsPictures used in this presentation are creative commons attribution licensed pictures. Here are the owners and the URLS where the originals can be found:

‘Multiple Padlock Farm Gate’ by Mike Baird - http://www.flickr.com/photos/mikebaird/2354116406/

‘Love Locks’ by James Manners - http://www.flickr.com/photos/jmanners/443421045/

‘Seguridad’ by Juan J. Martinez - http://www.flickr.com/photos/reidrac/4696900602/

‘Hotel Keys by Henri Bergius - http://www.flickr.com/photos/bergie/3468886680/

‘OAuth Shiny’ by Chris Messina - http://www.flickr.com/photos/factoryjoe/3343062926/

‘Take a number please’ by Andres Rueda - http://www.flickr.com/photos/andresrueda/3259487071/

’38/365 Puzzled’ by Mykl Roventine - http://www.flickr.com/photos/myklroventine/3261364899/

‘Visiting Portage’ by Jeremy Bronson - http://www.flickr.com/photos/jbrons/4444017497/

‘_dsc8037’ by Sergey Vladimirov - http://www.flickr.com/photos/vlsergey/4138735474/

Application logo’s and other icons have been used under the assumption that use of them in this context is considered fair use.