building persona: federated and privacy-sensitive identity for the web (lca 2013)

136
François Marier – @fmarier Building Persona federated & privacy-sensitive identity for the web

Upload: francois-marier

Post on 08-May-2015

1.578 views

Category:

Technology


3 download

DESCRIPTION

This talk explores the challenges of the existing Web identity solutions and introduce the choices that were made during the development of Persona (formerly BrowserID), a new Open Source federated identity solution from Mozilla, designed and built to respect user privacy.

TRANSCRIPT

Page 1: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

François Marier – @fmarier

B u i l d i n g P e r s o n afederated & privacy-sensitive identity for the web

Page 2: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 3: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 4: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 5: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 6: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

solving thepassword problem

on the web

Page 7: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

Username:francois

Password:****************

X

Sign in

Page 8: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

security

Page 9: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 10: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 11: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 12: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 13: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 14: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 15: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

bcrypt

per-user salt

site secret

password & lockout policies

secure recovery

Page 16: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

bcrypt

per-user salt

site secret

password & lockout policies

secure recovery

Page 17: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

bcrypt

per-user salt

site secret

password & lockout policies

secure recovery

Page 18: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

bcrypt

per-user salt

site secret

password & lockout policies

secure recovery

Page 19: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

bcrypt

per-user salt

site secret

password & lockout policies

secure recovery

Page 20: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

bcrypt

per-user salt

site secret

password & lockout policies

secure recovery

20132013

passwordpassword

guidelines

guidelines

Page 21: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 22: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

conversionrate

Page 23: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

# hits

signup

Page 24: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

# hits

signup signup_complete

Page 25: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

# hits

signup signup_complete

l o s t cust-omers

Page 26: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

existing solutions

Page 27: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

client certificates

Page 28: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

centralized authorities

Page 29: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 30: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

so...

storing passwords is hard

Page 31: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

so...

storing passwords is hard

no suitable alternatives

Page 32: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 33: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

decentralized

Page 34: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

privacy-sensitivedecentralized

Page 35: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

privacy-sensitive

simple

decentralized

Page 36: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

privacy-sensitive

simpleopen source

decentralized

Page 37: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

in your browser

Page 38: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

how does it work?

Page 40: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

getting a proof of email ownership

Page 41: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

authenticate?

Page 42: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

authenticate?

public key

Page 43: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

authenticate?

public key

signed public key

Page 44: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

you have a signed statement from yourprovider that you own your email address

Page 45: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 46: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 47: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 48: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 49: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 50: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 51: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 52: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

logging into a 3rd party site

Page 53: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

Valid for: 2 minutes

linux.conf.au

assertion

Page 54: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

Valid for: 2 minutes

linux.conf.au

check audience

assertion

Page 55: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

Valid for: 2 minutes

linux.conf.au

check audiencecheck expiry

assertion

Page 56: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

Valid for: 2 minutes

linux.conf.au

check audiencecheck expirycheck signature

assertion

Page 57: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

assertion

Valid for: 2 minutes

linux.conf.au

public key

Page 58: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

assertion

Valid for: 2 minutes

linux.conf.au

Page 59: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

assertion

session cookie

Page 60: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

achievingthat vision

Page 61: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 62: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

email providers

browser vendors

Page 63: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

email providers

Page 66: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

fallback identity provider

Page 67: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 68: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 69: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 70: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

persona.org account

Page 71: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

support for all email providers

Page 72: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

browser vendors

Page 73: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.*

Page 74: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 75: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 76: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 77: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

js

Page 78: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

support for allmodern browsers

>= 8

Page 79: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

support for allmodern browsers

>= 8

Page 80: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

LIFD

Page 81: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

LocallyIsolatedFeatureDomain

Page 82: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

wanted: trusted coderunning in the browser

Page 83: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

login.persona.org

Page 84: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

localStorage

localStorage.setItem("key", serializedKey);

var serializedKey = localStorage.getItem("key");

Page 85: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

storage tied tologin.persona.org

Page 86: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

window.postMessage()

Page 87: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

https://login.persona.org

postMessage

localStorage

Page 88: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

https://login.persona.org

localStorage

questions?

postMessage

Page 89: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

live demo

Page 90: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

using it on your site

Page 91: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 92: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

<script src=”https://login.persona.org/include.js”></script></body></html>

Page 93: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.watch({ loggedInEmail: “[email protected]”, onlogin: function (assertion) { $.post('/login', {assertion: assertion}, function (data) { // do something } ); }, onlogout: function () { window.location = '/logout'; }});

Page 94: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.watch({ loggedInUser: “[email protected]”, onlogin: function (assertion) { $.post('/login', {assertion: assertion}, function (data) { // do something } ); }, onlogout: function () { window.location = '/logout'; }});

Page 95: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.watch({ loggedInUser: null, onlogin: function (assertion) { $.post('/login', {assertion: assertion}, function (data) { // do something } ); }, onlogout: function () { window.location = '/logout'; }});

Page 96: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.watch({ loggedInUser: null, onlogin: function (assertion) { $.post('/login', {assertion: assertion}, function (data) { // do something } ); }, onlogout: function () { window.location = '/logout'; }});

Page 97: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.watch({ loggedInUser: null, onlogin: function (assertion) { $.post('/login', {assertion: assertion}, function (data) { window.location = '/'; } ); }, onlogout: function () { window.location = '/logout'; }});

Page 98: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 99: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.request()

Page 100: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 101: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 102: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 103: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.watch({ loggedInUser: null, onlogin: function (assertion) { $.post('/login', {assertion: assertion}, function (data) { window.location = '/'; } ); }, onlogout: function () { window.location = '/logout'; }});

Page 104: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.watch({ loggedInUser: null, onlogin: function (assertion) { $.post('/login', {assertion: assertion}, function (data) { window.location = '/home'; } ); }, onlogout: function () { window.location = '/logout'; }});

Page 105: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

def verify_assertion(assertion):

page = requests.post( 'https://verifier.login.persona.org/verify', Data={ "assertion": assertion, "audience": 'http://123done.org'})

data = page.json return data.status == 'okay'

Page 106: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

def verify_assertion(assertion):

page = requests.post( 'https://verifier.login.persona.org/verify', Data={ "assertion": assertion, "audience": 'http://123done.org'})

data = page.json return data.status == 'okay'

Page 107: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

{ status: “okay”,

audience: “http://123done.org”,

expires: 1344849682560,

email: “[email protected]”,

issuer: “login.persona.org”}

Page 108: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

{ status: “failed”,

reason: “assertion has expired”}

Page 109: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 110: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 111: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 112: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.logout()

Page 113: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

navigator.id.watch({ loggedInUser: null, onlogin: function (assertion) { $.post('/login', {assertion: assertion}, function (data) { window.location = '/home'; } ); }, onlogout: function () { window.location = '/logout'; }});

Page 114: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)
Page 115: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

1. load javascript library

Page 116: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

1. load javascript library

2. setup login & logout callbacks

Page 117: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

1. load javascript library

2. setup login & logout callbacks

3. add login and logout buttons

Page 118: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

1. load javascript library

2. setup login & logout callbacks

3. add login and logout buttons

4. verify proof of ownership

Page 119: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

<?php

if (!empty($_POST)) { $result = verify_assertion($_POST['assertion']); if ($result->status === 'okay') { print_header(); echo "<p>Logged in as: " . $result->email . "</p>"; echo '<p><a href="javascript:do_logout()">Logout</a></p>'; print_backLink(); print_footer($result->email); } else { print_header(); echo "<p>Error: " . $result->reason . "</p>"; print_backLink(); print_footer(); }} elseif (!empty($_GET['logout'])) { print_header(); echo "<p>You have logged out.</p>"; print_backLink(); print_footer();} else { print_header(); echo "<p><a href=\"javascript:do_login()\">Login</a></p>"; print_footer();}

function print_header() { echo <<<EOF<!DOCTYPE html><html><head><meta charset="utf-8"></head><body><form id="login-form" method="POST"><input id="assertion-field" type="hidden" name="assertion" value=""></form>EOF;}

function print_backLink() { echo "<p><a href=\"persona.php\">Back to login page</a></p>";}

function print_footer($email = 'null') { if ($email !== 'null') { $email = "'$email'"; } echo <<<EOF<script src="http://127.0.0.1:10002/include.orig.js"></script><script>

function do_login() { navigator.id.request();}function do_logout() { navigator.id.logout();}

navigator.id.watch({ loggedInUser: $email, onlogin: function (assertion) { alert("onlogin: $email"); var assertion_field = document.getElementById("assertion-field"); assertion_field.value = assertion; var login_form = document.getElementById("login-form"); login_form.submit(); }, onlogout: function () { alert("onlogout: $email"); window.location = '?logout=1'; }});</script></body></html>EOF;}

function verify_assertion($assertion) { $audience = ($_SERVER['HTTPS'] === 'on' ? 'https://' : 'http://') . $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT']; $postdata = 'assertion=' . urlencode($assertion) . '&audience=' . urlencode($audience);

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://verifier.login.persona.org/verify"); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); $json = curl_exec($ch); curl_close($ch);

$res = json_decode($json); $res->status = 'okay'; $res->email = '[email protected]'; return $res;}?>

Page 120: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

wanna help ussolve the

password problem?

Page 121: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

add Persona toyour project/site

tell us about yourexperience

email one siteasking for it

Page 122: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

add Persona toyour project/site

tell us about yourexperience

email one siteasking for it

Page 123: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

add Persona toyour project/site

tell us about yourexperience

email one siteasking for it

Page 124: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

grab some stickers!

Page 125: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

To learn more about Persona:

https://login.persona.org/http://identity.mozilla.com/

https://developer.mozilla.org/docs/Persona/Why_Personahttps://developer.mozilla.org/docs/Persona/Quick_Setup

https://github.com/mozilla/browserid-cookbookhttps://developer.mozilla.org/docs/Persona/Libraries_and_plugins

http://123done.org/https://wiki.mozilla.org/Identity#Get_Involved

@fmarier http://fmarier.org

Page 126: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

© 2013 François Marier <[email protected]>This work is licensed under aCreative Commons Attribution-ShareAlike 3.0 New Zealand License.

Top 500 passwords: http://xato.net/passwords/more-top-worst-passwords/

Parchment: https://secure.flickr.com/photos/27613359@N03/6750396225/

Elephant in room: https://secure.flickr.com/photos/bitboy/246805948/

Cookie on tray: https://secure.flickr.com/photos/jamisonjudd/4810986199/

Uncle Sam: https://secure.flickr.com/photos/donkeyhotey/5666065982/

Photo credits:

Page 128: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

identity provider API

https://eyedee.me/.well-known/browserid:

{ "public-key": { "algorithm":"RS", "n":"8606...", "e":"65537" }, "authentication": "/browserid/sign_in.html", "provisioning": "/browserid/provision.html"}

Page 129: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

https://eyedee.me/.well-known/browserid:

{ "public-key": { "algorithm":"RS", "n":"8606...", "e":"65537" }, "authentication": "/browserid/sign_in.html", "provisioning": "/browserid/provision.html"}

identity provider API

Page 130: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

https://eyedee.me/.well-known/browserid:

{ "public-key": { "algorithm":"RS", "n":"8606...", "e":"65537" }, "authentication": "/browserid/sign_in.html", "provisioning": "/browserid/provision.html"}

identity provider API

Page 131: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

https://eyedee.me/.well-known/browserid:

{ "public-key": { "algorithm":"RS", "n":"8606...", "e":"65537" }, "authentication": "/browserid/sign_in.html", "provisioning": "/browserid/provision.html"}

identity provider API

Page 132: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

https://eyedee.me/.well-known/browserid:

{ "public-key": { "algorithm":"RS", "n":"8606...", "e":"65537" }, "authentication": "/browserid/sign_in.html", "provisioning": "/browserid/provision.html"}

identity provider API

Page 133: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

identity provider API

1. check for your /.well-known/browserid

2. try the provisioning endpoint

3. show the authentication page

4. call the provisioning endpoint again

Page 134: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

identity provider API

1. check for your /.well-known/browserid

2. try the provisioning endpoint

3. show the authentication page

4. call the provisioning endpoint again

Page 135: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

identity provider API

1. check for your /.well-known/browserid

2. try the provisioning endpoint

3. show the authentication page

4. call the provisioning endpoint again

Page 136: Building Persona: federated and privacy-sensitive identity for the Web (LCA 2013)

identity provider API

1. check for your /.well-known/browserid

2. try the provisioning endpoint

3. show the authentication page

4. call the provisioning endpoint again