60
OpenID Authentication by example BPW2007 chrisv.cpan.org (introductory slides: thanks to Simon Willison) 1 Saturday 27 October 2007

OpenID Authentication by example

Embed Size (px)

Citation preview

Page 1: OpenID Authentication by example

OpenID Authenticationby example

BPW2007chrisv.cpan.org

(introductory slides: thanks to Simon Willison)

1Saturday 27 October 2007

Page 2: OpenID Authentication by example

usernames & passwords suck

2Saturday 27 October 2007

Page 3: OpenID Authentication by example

signing up for new accounts is a pain

3Saturday 27 October 2007

Page 4: OpenID Authentication by example

my online identity exists in multiple

(hard to manage) places

4Saturday 27 October 2007

Page 5: OpenID Authentication by example

user database theft

5Saturday 27 October 2007

Page 6: OpenID Authentication by example

password/cc info theft

6Saturday 27 October 2007

Page 7: OpenID Authentication by example

too much passwords, too much userids

7Saturday 27 October 2007

Page 8: OpenID Authentication by example

we need single signon

8Saturday 27 October 2007

Page 9: OpenID Authentication by example

unified, trusted identity

9Saturday 27 October 2007

Page 10: OpenID Authentication by example

OpenID is a decentralized

mechanism for single signon

10Saturday 27 October 2007

Page 11: OpenID Authentication by example

OpenID is a URL

11Saturday 27 October 2007

Page 12: OpenID Authentication by example

http://vertonghen.livejournal.com

12Saturday 27 October 2007

Page 13: OpenID Authentication by example

http://vertonghen.myopenid.com

13Saturday 27 October 2007

Page 14: OpenID Authentication by example

http://chris.vertonghen.org

14Saturday 27 October 2007

Page 15: OpenID Authentication by example

The OpenID protocol lets you prove that you

own a specific URL

15Saturday 27 October 2007

Page 16: OpenID Authentication by example

An OpenID can be used as an

authentiation credential

16Saturday 27 October 2007

Page 17: OpenID Authentication by example

Site: “Who are you?”

17Saturday 27 October 2007

Page 18: OpenID Authentication by example

Me: “I’m chris.vertonghen.org”

18Saturday 27 October 2007

Page 19: OpenID Authentication by example

Site: “Prove it”

19Saturday 27 October 2007

Page 20: OpenID Authentication by example

(some magic happens)

20Saturday 27 October 2007

Page 21: OpenID Authentication by example

Site: “ok you’re in!”

21Saturday 27 October 2007

Page 22: OpenID Authentication by example

Picking an OpenID is like picking an email

provider - you find one that you trust

22Saturday 27 October 2007

Page 23: OpenID Authentication by example

If you have the ability to run your own server

software, you can do so yourself

23Saturday 27 October 2007

Page 24: OpenID Authentication by example

(demo)http://www.wooblelab.com/

24Saturday 27 October 2007

Page 25: OpenID Authentication by example

So my users don’t

have to sign up for an account?

25Saturday 27 October 2007

Page 26: OpenID Authentication by example

Not necessarily

26Saturday 27 October 2007

Page 27: OpenID Authentication by example

An OpenID tells you

very little about a user

27Saturday 27 October 2007

Page 28: OpenID Authentication by example

You don’t know

their name

28Saturday 27 October 2007

Page 29: OpenID Authentication by example

You don’t know

their e-mail address

29Saturday 27 October 2007

Page 30: OpenID Authentication by example

You don’t know

if they’re a person

or an evil robot

30Saturday 27 October 2007

Page 31: OpenID Authentication by example

You have to ask them!

31Saturday 27 October 2007

Page 32: OpenID Authentication by example

OpenID can help them answer

32Saturday 27 October 2007

Page 33: OpenID Authentication by example

(demo)http://www.welovelocal.com/

33Saturday 27 October 2007

Page 34: OpenID Authentication by example

So how doesOpenID work?

34Saturday 27 October 2007

Page 35: OpenID Authentication by example

35Saturday 27 October 2007

Page 36: OpenID Authentication by example

36Saturday 27 October 2007

Page 37: OpenID Authentication by example

Use multiple OpenIDs to maintain multiple online

personas

37Saturday 27 October 2007

Page 38: OpenID Authentication by example

professional

social

secret

...

38Saturday 27 October 2007

Page 39: OpenID Authentication by example

OpenID and web service APIs naturally

complement each other

39Saturday 27 October 2007

Page 40: OpenID Authentication by example

Me: “I’m vertonghen.myopenid.com”

40Saturday 27 October 2007

Page 41: OpenID Authentication by example

Site fetches HTML,

discovers identity provider

41Saturday 27 October 2007

Page 42: OpenID Authentication by example

Establishes shared secret

with identity provider

(Using Diffie-Hellman key exchange)

42Saturday 27 October 2007

Page 43: OpenID Authentication by example

Redirects you to the identity provider

43Saturday 27 October 2007

Page 44: OpenID Authentication by example

when you’re logged in there, you get redirected back

44Saturday 27 October 2007

Page 45: OpenID Authentication by example

How does my identity

provider know who I am?

45Saturday 27 October 2007

Page 46: OpenID Authentication by example

OpenID deliberately doesn’t specify

46Saturday 27 October 2007

Page 47: OpenID Authentication by example

username/password

is common

47Saturday 27 October 2007

Page 48: OpenID Authentication by example

But providers can use other methods if

they want to

48Saturday 27 October 2007

Page 49: OpenID Authentication by example

Client SSL certificates

49Saturday 27 October 2007

Page 50: OpenID Authentication by example

Out of band authentication via SMS,

e-mail or Jabber

50Saturday 27 October 2007

Page 51: OpenID Authentication by example

No authentication at all (just say “Yes”)

(which is the OpenID version of bugmenot.com)

51Saturday 27 October 2007

Page 52: OpenID Authentication by example

What if I decide I

suddenly hate my provider?

52Saturday 27 October 2007

Page 53: OpenID Authentication by example

Use your own

domain name

53Saturday 27 October 2007

Page 54: OpenID Authentication by example

and delegate to a provider you trust

54Saturday 27 October 2007

Page 55: OpenID Authentication by example

55Saturday 27 October 2007

Page 56: OpenID Authentication by example

56Saturday 27 October 2007

Page 57: OpenID Authentication by example

perl OpenID client

57Saturday 27 October 2007

Page 58: OpenID Authentication by example

Net::OpenID::Consumerby Brad Fitzpatrick (of course)

58Saturday 27 October 2007

Page 59: OpenID Authentication by example

use Net::OpenID::Consumer;

my $csr = Net::OpenID::Consumer->new( ua => LWPx::ParanoidAgent->new, cache => Some::Cache->new, args => $cgi, consumer_secret => ..., required_root => "http://chris.vertonghen.org/", );

# a user entered, say, "bradfitz.com" as their identity. The first # step is to fetch that page, parse it, and get a # Net::OpenID::ClaimedIdentity object:

my $claimed_identity = $csr->claimed_identity("bradfitz.com");

# now your app has to send them at their identity server's endpoint # to get redirected to either a positive assertion that they own # that identity, or where they need to go to login/setup trust/etc.

my $script_name = "http://" . $ENV{'HTTP_HOST'} . $ENV{'SCRIPT_NAME'};

my $check_url = $claimed_identity->check_url( return_to => $script_name . "?return=true&hurl=$hurl&oid=" . $m->interp()->apply_escapes($identity), trust_root => "http://chris.vertonghen.org/", );

# so you send the user off there, and then they come back to # openid-check.mhtml, then you see what the identity server said; if ($return) { if ( $setup_url = $openid_con->user_setup_url ) { print $m->redirect($setup_url); } elsif ( $verify_identity = $openid_con->verified_identity ) { $verified_url = $verify_identity->url; print 'Congratulations your identity has been verified.<BR><BR>'; } elsif ( $openid_con->user_cancel ) { $m->redirect('http://chris.vertonghen.org/auth.html'); #use the file name of the login page } else { print "<BR><h1>Validation Error</h1>"; print 'There was an error in validating your identity. The error was ', $openid_con->err . "<BR><BR>Please <a href=\"javascript: history.go(-1);\">go back and try again</a>.<BR><BR>"; } }

59Saturday 27 October 2007

Page 60: OpenID Authentication by example

Thank you.

Questions?

60Saturday 27 October 2007