Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Confoo 2012: Defining User Identity

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Confoo 2012: Defining User Identity

Defining User Identity talk from my March 2012 Confoo presentation

Jonathan LeBlanc

February 29, 2012

Transcript

42 slides
  1. Defining  User  Iden-ty   True  Iden-ty  VS  Anonymity   Jonathan

     LeBlanc   Developer  Evangelist:  X.commerce   Email:  [email protected]   Twi?er:  @jcleblanc  
  2. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   The  FoundaKons

     of  Human  IdenKty   Tribalism  and  Social  Grouping   The  Big  Bag  of  Social  IdenKty  Fail   Experimental  IdenKty  Methods   What  We’re  Going  to  Cover  
  3. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   The  FoundaKons

     of  Human  IdenKty   Tribalism  and  Social  Grouping   The  Big  Bag  of  Social  IdenKty  Fail   Experimental  IdenKty  Methods   What  We’re  Going  to  Cover  
  4. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Human  IdenKty:

     User  Types   Anonymous  Users   Real  IdenKty  Login  
  5. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   OAuth  (1.0a

     +  2.0)   PayPal  Access,  Facebook,  Twi?er     OpenID  (…and  the  upcoming  OpenID  Connect)   PayPal  Access,  Google,  Yahoo!     BrowserID   Mozilla   Human  IdenKty:  Open  IdenKty  Programming  
  6. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   There  are

     a  few  common  op-ons   Human  IdenKty:  Tracking  Anonymous  Users   Tracking  Cookie   Local  Storage  
  7. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   •  On

     each  page  visited,  track  the  URL   •  HTML5  Local  Storage  as  primary  storage   •  Cookies  as  secondary  storage   Human  IdenKty:  Tracking  Anonymous  Users   Program  Overview  
  8. Tracking  Anonymous  Users  with  Local  Storage   var  storeName  =

     "visited";   if  (typeof(localStorage)  ==  'undefined'  )  {          //Local  Storage  Not  Available   }  else  {          try  {                  var  sites  =  localStorage.getItem(storeName);                  sites  =  (sites  ===  null)  ?  window.loca-on  :  sites  +  window.loca-on;                    localStorage.setItem(storeName,  sites  +  "|");            }  catch  (e)  {                  if  (e  ==  QUOTA_EXCEEDED_ERR)  {                          //quota  exceeded                  }          }   }  
  9. Tracking  Anonymous  Users  with  Cookies   func-on  readCookie(name)  {  

           var  nameEQ  =  name  +  "=";          var  ca  =  document.cookie.split(';');          for  (var  i  =  0;  i  <  ca.length;  i++)  {                  var  c  =  ca[i];                  while  (c.charAt(0)  ==  '  '){  c  =  c.substring(1,  c.length)  };                  if  (c.indexOf(nameEQ)  ==  0){                            return  c.substring(nameEQ.length,  c.length);                    }          }          return  null;   }  
  10. var  storeName  =  "visited";   if  (typeof(localStorage)  ==  "undefined"  )

     {          var  cookieVal  =  readCookie(storeName);          var  value  =  ((cookieVal  ===  null)  ?  window.locaKon  :  cookieVal                                                  +  window.locaKon);                      var  days  =  1;          var  date  =  new  Date();          date.setTime(date.getTime()  +  (days*24*60*60*1000));          var  expires  =  ";  expires="  +  date.toGMTString();          document.cookie  =  storeName  +  "="  +  value  +  "|"                                                                            +  expires  +  ";  path=/";   }  else  {          //Use  Local  Storage   }   Tracking  Anonymous  Users  with  Cookies  
  11. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   •  Remove

     oldest  results  when  storage  fills   •  Build  categorizaKon  mapping  prior  to   storage  to  save  space  (more  on  this  later)   Human  IdenKty:  Tracking  Anonymous  Users   Next  Steps  /  Improvements  
  12. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Human  IdenKty:

     Real  IdenKty  Sources   Social  (perceived)   Concrete  (true)       Sources  of  Real  Iden-ty  
  13. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   BrowserID  Source

      <script  src="h?ps://browserid.org/include.js"   type="text/javascript"></script>     JQuery  Source   <script  src="h?p://code.jquery.com/jquery.min.js"   type="text/javascript"></script>   Human  IdenKty:  BrowserID    
  14. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Human  IdenKty:

     BrowserID     navigator.id.get(func-on(asserKon)  {          if  (asserKon)  {                  $.ajax({                          url:  'h?ps://browserid.org/verify',                          type:  'POST',                          data:  'asserKon='+asserKon+'&audience=jcleblanc.com',                          success:  func-on(res)  {                                  console.log(res);                          }                  });   });  
  15. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   {  

           audience:  "jcleblanc.com",          email:  "[email protected]",          expires:  1320081400987,          issuer:  "browserid.org",          status:  "okay"   }   Human  IdenKty:  BrowserID  JSON  Results  
  16. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   The  FoundaKons

     of  Human  IdenKty   Tribalism  and  Social  Grouping   The  Big  Bag  of  Social  IdenKty  Fail   Experimental  IdenKty  Methods   What  We’re  Going  to  Cover  
  17. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Tribalism  started

     as  a  way  to  keep  us  safe     …it  has  lead  to  some  horrible  parts  of  history     but  it  is  also  a  foundaKon  of  many  of  our  social   relaKonships       Social  Grouping:  FoundaKon  in  Tribalism  
  18. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Social  Grouping:

     Group  Types   Follower  Type   ConnecKon  Type   Group  Type  
  19. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   •  Use

     all  URLs  from  the  previous  program.   •  Obtain  content  category  for  page.   •  Categorize  user  interest.     Social  Grouping:  Group  Programming  Primer   Program  Overview  
  20. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Social  Grouping:

     Group  Programming  Primer   Step  1:  Obtain   Website  Content  
  21. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Social  Grouping:

     Group  Programming  Primer   Step  2:  Perform   Keyword  Density   Search  
  22. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Social  Grouping:

     Group  Programming  Primer   Step  3:  Weight   Keywords  
  23. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   The  FoundaKons

     of  Human  IdenKty   Tribalism  and  Social  Grouping   The  Big  Bag  of  Social  IdenKty  Fail   Experimental  IdenKty  Methods   What  We’re  Going  to  Cover  
  24. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce      

    “My  privacy  concerns  are  not  trite.   They  are  linked  to  my  actual   physical  safety”       -­‐-­‐Harriet  Jacobs  (Gizmodo)   Social  IdenKty  Fail:  Personal  Safety   When  Social  Discovery  Impacts  Personal  Safety  
  25. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce      

    “Path  Uploads  Your  EnKre  iPhone   Contact  List  By  Default”       -­‐-­‐Mark  Hachman  (PCMag)   Social  IdenKty  Fail:  Privacy  Concerns   When  Making  Things  Easy  Impairs  Privacy  
  26. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce      

    “How  Target  Figured  Out  A  Teen  Girl   Was  Pregnant  Before  Her  Father  Did”       -­‐-­‐Kashmir  Hill  (Forbes)   Social  IdenKty  Fail:  The  Fine  Line   The  Fine  Line  Between  Insighaul  and  Creepy  
  27. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   The  FoundaKons

     of  Human  IdenKty   Tribalism  and  Social  Grouping   The  Big  Bag  of  Social  IdenKty  Fail   Experimental  IdenKty  Methods   What  We’re  Going  to  Cover  
  28. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Step  1:

     Perform  Discovery     curl  h?ps://gmail.com/.well-­‐known/host-­‐meta       Experimental  IdenKty:  WebFinger  
  29. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Experimental  IdenKty:

     WebFinger   <XRD  xmlns='h?p://docs.oasis.open.org/ns/xri/xrd-­‐1.0'              xmlns:hm='h?p://host-­‐meta.net/xrd/1.0'>          <hm:Host  xmlns='h?p://host-­‐meta.net/xrd/1.0'>gmail.com          </hm:Host>          <Link  rel='lrdd'                    template='h?p://www.google.com/s2/webfinger/?q={uri}'>                  <Title>Resource  Descriptor</Title>          </Link>   </XRD>  
  30. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   Step  2:

     Collect  User  Data     curl  h?p://www.google.com/s2/webfinger/? [email protected]       Experimental  IdenKty:  WebFinger  
  31. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   User  Profile

      h?p://www.google.com/profiles/ nakedtechnologist   Portable  Contacts   h?p://www-­‐opensocial.googleusercontent.com/ api/people/118167121283215553793/   Experimental  IdenKty:  WebFinger  
  32. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   profileUrl  

    id   thumbnail  url   urls   photos   Experimental  IdenKty:  WebFinger   name        forma?ed        family  name        given  name        display  name    
  33. X.Commerce  (eBay  Inc.)   h?p://www.x.com  |  @x_commerce   IdenKty  is

     more  than  just  a  login     AuthenKcaKon  is  just  the  first  step     Find  the  tool  that:   – Has  the  raw  data  that  you  need   – Works  with  your  business   IdenKty  Programming  Core  Concepts  
  34. Thanks!  Any  Ques-ons?     Jonathan  LeBlanc   Email:  [email protected]

      Twi?er:  @jcleblanc   Github:  h?ps://github.com/jcleblanc   hcp://slidesha.re/confoo_iden-ty2  

More Decks by Jonathan LeBlanc

Other Decks in Technology