Slide 1

Slide 1 text

François Marier – @fmarier Easy logins for JavaScript web applications

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

No content

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

problem #1: passwords are hard to secure

Slide 13

Slide 13 text

bcrypt / scrypt / pbkdf2 per-user salt site secret password & lockout policies secure recovery

Slide 14

Slide 14 text

bcrypt / scrypt / pbkdf2 per-user salt site secret password & lockout policies secure recovery

Slide 15

Slide 15 text

bcrypt / scrypt / pbkdf2 per-user salt site secret password & lockout policies secure recovery

Slide 16

Slide 16 text

bcrypt / scrypt / pbkdf2 per-user salt site secret password & lockout policies secure recovery

Slide 17

Slide 17 text

bcrypt / scrypt / pbkdf2 per-user salt site secret password & lockout policies secure recovery

Slide 18

Slide 18 text

bcrypt / scrypt / pbkdf2 per-user salt site secret password & lockout policies secure recovery 2013 2013 password password guidelines guidelines

Slide 19

Slide 19 text

passwords are hard to secure they are a liability

Slide 20

Slide 20 text

ALTER TABLE user DROP COLUMN password;

Slide 21

Slide 21 text

problem #2: passwords are hard to remember

Slide 22

Slide 22 text

pick an easy password

Slide 23

Slide 23 text

pick an easy password use it everywhere

Slide 24

Slide 24 text

passwords are hard to remember they need to be reset

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

control email account control all accounts =

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

“People want a little dating before marriage.” Eric Vishria – Rockmelt

Slide 29

Slide 29 text

No content

Slide 30

Slide 30 text

decentralised

Slide 31

Slide 31 text

myid.com/u/francois

Slide 32

Slide 32 text

No content

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

privacy ®

Slide 35

Slide 35 text

existing login systems are not good enough

Slide 36

Slide 36 text

ideal web-wide identity system

Slide 37

Slide 37 text

ideal web-wide identity system

Slide 38

Slide 38 text

ideal web-wide identity system

Slide 39

Slide 39 text

ideal web-wide identity system

Slide 40

Slide 40 text

what if it were a standard part of the web browser?

Slide 41

Slide 41 text

No content

Slide 42

Slide 42 text

how does it work?

Slide 43

Slide 43 text

Slide 44

Slide 44 text

Slide 45

Slide 45 text

getting a proof of email ownership

Slide 46

Slide 46 text

authenticate?

Slide 47

Slide 47 text

authenticate? public key

Slide 48

Slide 48 text

authenticate? public key signed public key

Slide 49

Slide 49 text

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

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

logging into a 3rd party site

Slide 52

Slide 52 text

Valid for: 2 minutes wikipedia.org assertion

Slide 53

Slide 53 text

Valid for: 2 minutes wikipedia.org check audience assertion

Slide 54

Slide 54 text

Valid for: 2 minutes wikipedia.org check audience check expiry assertion

Slide 55

Slide 55 text

Valid for: 2 minutes wikipedia.org check audience check expiry check signature assertion

Slide 56

Slide 56 text

assertion Valid for: 2 minutes wikipedia.org public key

Slide 57

Slide 57 text

assertion Valid for: 2 minutes wikipedia.org

Slide 58

Slide 58 text

assertion session cookie

Slide 59

Slide 59 text

demo #1: http://www.voo.st/ http://www.debuggex.com [email protected]

Slide 60

Slide 60 text

Persona is already a decentralised system

Slide 61

Slide 61 text

decentralisation is the answer, but it's not a product adoption strategy

Slide 62

Slide 62 text

we can't wait for all domains to adopt Persona

Slide 63

Slide 63 text

we can't wait for all domains to adopt Persona solution: a temporary centralised fallback

Slide 64

Slide 64 text

demo #2: http://sloblog.io/ [email protected]

Slide 65

Slide 65 text

Persona already works with all email domains

Slide 66

Slide 66 text

identity bridging

Slide 67

Slide 67 text

demo #3: http://www.reasonwell.com/ [email protected]

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

No content

Slide 71

Slide 71 text

Persona supports all modern browsers >= 8

Slide 72

Slide 72 text

Persona is decentralised, simple and cross-browser

Slide 73

Slide 73 text

it's simple for users, but is it also simple for developers?

Slide 74

Slide 74 text

No content

Slide 75

Slide 75 text

Slide 76

Slide 76 text

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

Slide 77

Slide 77 text

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

Slide 78

Slide 78 text

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

Slide 79

Slide 79 text

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

Slide 80

Slide 80 text

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

Slide 81

Slide 81 text

No content

Slide 82

Slide 82 text

navigator.id.request()

Slide 83

Slide 83 text

No content

Slide 84

Slide 84 text

No content

Slide 85

Slide 85 text

No content

Slide 86

Slide 86 text

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

Slide 87

Slide 87 text

eyJhbGciOiJEUzEyOCJ9.eyJwdWJsaWMta2V5Ijp7ImFsZ29yaXRobSI6IkRTIiwieSI6ImNhZDg2ZDg yNWU0MjBkMGI4Njk5MjM4ZDM5ZTFjYjIyOGMyMTk1NWFiMzcwOTQ1YzExNzBhMzM4NjcyNDM0ZDJmNGY xZDg5ZjFkZjMzNmU1ZjZjZjk2YjhiOTlmMjgyNmFjNTYxZmI1YWMyYTc4ZjNhMzBkNGYxNTVhYjc3ZGE xYmY3MWU4ZGMzNjQ0MmU2NjQ3MmE5Mjg0N2I2Y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xOCwiaXNzIjoibW9ja215aWQuY29tIn0.IeUR0_3ayAZkdNSXjF4aaCwSHnHa4X1lzrjX-qkNcPI bXx1hmQQPwg~eyJhbGciOiJEUzEyOCJ9.eyJleHAiOjEzNzY1MzY3MDc2MzUsImF1ZCI6Imh0dHA6Ly9 sb2NhbGhvc3QifQ.NJ8H1qZcWXbXfPJSdgB_mORHQ442ZkY0XYfdQsZZsIjooG7k7qWyVw

Slide 88

Slide 88 text

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

Slide 89

Slide 89 text

npm install browserid-verify

Slide 90

Slide 90 text

const verify = require('browserid-verify')(); verify(assertion, 'http://123done.org', function(err, email, response) { if (err) { return console.log(err); } if (email) { session.user = response.email; } else { delete session.user; } });

Slide 91

Slide 91 text

{ status: “okay”, audience: “http://123done.org”, expires: 1344849682560, email: “[email protected]”, issuer: “login.persona.org” }

Slide 92

Slide 92 text

const verify = require('browserid-verify')(); verify(assertion, 'http://123done.org', function(err, email, response) { if (err) { return console.log(err); } if (email) { session.user = response.email; } else { delete session.user; } });

Slide 93

Slide 93 text

{ status: “failed”, reason: “assertion has expired” }

Slide 94

Slide 94 text

const verify = require('browserid-verify')(); verify(assertion, 'http://123done.org', function(err, email, response) { if (err) { return console.log(err); } if (email) { session.user = response.email; } else { delete session.user; } });

Slide 95

Slide 95 text

No content

Slide 96

Slide 96 text

No content

Slide 97

Slide 97 text

navigator.id.logout()

Slide 98

Slide 98 text

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

Slide 99

Slide 99 text

No content

Slide 100

Slide 100 text

1. load javascript library

Slide 101

Slide 101 text

1. load javascript library 2. setup login & logout callbacks

Slide 102

Slide 102 text

1. load javascript library 2. setup login & logout callbacks 3. add login and logout buttons

Slide 103

Slide 103 text

1. load javascript library 2. setup login & logout callbacks 3. add login and logout buttons 4. verify proof of ownership

Slide 104

Slide 104 text

1. load javascript library 2. setup login & logout callbacks 3. add login and logout buttons 4. verify proof of ownership no API key needed

Slide 105

Slide 105 text

you can add support for Persona in four easy steps

Slide 106

Slide 106 text

Meteor express connect Jungles

Slide 107

Slide 107 text

one simple request

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

building a new site: default to Persona

Slide 110

Slide 110 text

working on an existing site/app: add support for Persona

Slide 111

Slide 111 text

before

Slide 112

Slide 112 text

after

Slide 113

Slide 113 text

after navigator.id.request()

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

ALTER TABLE user DROP COLUMN password;

Slide 116

Slide 116 text

To learn more about Persona: https://login.persona.org/ http://identity.mozilla.com/ https://developer.mozilla.org/docs/Persona/Why_Persona https://developer.mozilla.org/docs/Persona/Quick_Setup https://github.com/mozilla/browserid-cookbook https://developer.mozilla.org/docs/Persona/Libraries_and_plugins http://123done.org/ https://wiki.mozilla.org/Identity#Get_Involved @fmarier http://fmarier.org

Slide 117

Slide 117 text

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" }

Slide 118

Slide 118 text

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

Slide 119

Slide 119 text

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

Slide 120

Slide 120 text

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

Slide 121

Slide 121 text

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

Slide 122

Slide 122 text

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

Slide 123

Slide 123 text

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

Slide 124

Slide 124 text

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

Slide 125

Slide 125 text

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

Slide 126

Slide 126 text

© 2013 François Marier This work is licensed under a Creative 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/ Restaurant dinner: https://secure.flickr.com/photos/yourdon/3977084094/ Stop sign: https://secure.flickr.com/photos/artbystevejohnson/6673406227/ Photo credits: