Share
Embed
2012 ConvergeSE: Exploring Human Identity Through Personalization and Data Mining
This workshop dives into the depths of how a person can be identified online, allowing for the delivery of highly personalized experiences. This will cover a few topics, including:
Building the identity foundation using authentication systems like BrowserID, PayPal Access and Facebook Connect.
Understanding how cultural identity concepts like tribalism play into how people group themselves innately online.
Building personality and interest profiles for users by tracking actions using keyword density scraping and categorization.
Jonathan LeBlanc
April 24, 2012
Transcript
50 slides
-
Through Personaliza0on and Data Mining Exploring Human Iden0ty
Jonathan LeBlanc Developer Evangelist: X.commerce Twi;er: @jcleblanc E-‐Mail: [email protected] Github: github.com/jcleblanc -
h;p://www.x.com h;p://slideshare.net/jcleblanc The FoundaGons of Human IdenGty
Tribalism and Social Grouping Experimental IdenGty Methods The Big Bag of Social IdenGty Fail What We’re Going to Cover -
h;p://www.x.com h;p://slideshare.net/jcleblanc The Founda0ons of Human Iden0ty
Tribalism and Social Grouping Experimental IdenGty Methods The Big Bag of Social IdenGty Fail What We’re Going to Cover -
h;p://www.x.com h;p://slideshare.net/jcleblanc Human Iden0ty: User Types Anonymous
Users Real IdenGty Login -
h;p://www.x.com h;p://slideshare.net/jcleblanc OAuth (1.0a + 2.0) PayPal
Access, Facebook, Twi;er OpenID (…and the upcoming OpenID Connect) PayPal Access, Google, Yahoo! BrowserID Mozilla Human Iden0ty: Open Iden0ty Programming -
h;p://www.x.com h;p://slideshare.net/jcleblanc There are a few common op0ons
Human Iden0ty: Tracking Anonymous Users Tracking Cookie Local Storage -
h;p://www.x.com h;p://slideshare.net/jcleblanc • On each page visited, track
the URL • HTML5 Local Storage as primary storage • Cookies as secondary storage Human Iden0ty: Tracking Anonymous Users Program Overview -
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.loca0on : sites + window.loca0on; localStorage.setItem(storeName, sites + "|"); } catch (e) { if (e == QUOTA_EXCEEDED_ERR) { //quota exceeded } } } -
Tracking Anonymous Users with Cookies func0on 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; } -
var storeName = "visited"; if (typeof(localStorage) == "undefined" )
{ var cookieVal = readCookie(storeName); var value = ((cookieVal === null) ? window.locaGon : cookieVal + window.locaGon); 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 -
h;p://www.x.com h;p://slideshare.net/jcleblanc • Remove oldest results when storage
fills • Build categorizaGon mapping prior to storage to save space (more on this later) Human Iden0ty: Tracking Anonymous Users Next Steps / Improvements -
h;p://www.x.com h;p://slideshare.net/jcleblanc Human Iden0ty: Real Iden0ty Sources
Social (perceived) Concrete (true) Sources of Real Iden0ty -
h;p://www.x.com h;p://slideshare.net/jcleblanc PayPal Access: OAuth 2 + Commerce
Seamless Checkout Prospect Scores RecommendaGons -
PayPal Access: The Common Code <?php define('KEY',
'YOUR APPLICATION ID'); define('SECRET', 'YOUR APPLICATION SECRET'); define('CALLBACK_URL', 'YOUR CALLBACK PATH -‐ TO COMPLETE.PHP'); define('AUTH_ENDPOINT', 'h;ps://idenGty.x.com/xidenGty/resources/authorize'); define('TOKEN_ENDPOINT', 'h;ps://idenGty.x.com/xidenGty/oauthtokenservice'); define('USER_ENDPOINT', 'h;ps://idenGty.x.com/xidenGty/resources/profile/me'); func0on run_curl($url, $method = 'GET', $postvals = null){ ... } ?> -
PayPal Access: Forwarding for Login <?php require_once "common.php";
$auth_url = sprinb( "%s?scope=%s&response_type=code&redirect_uri=%s&client_id=%s", AUTHORIZATION_ENDPOINT, urlencode("h;ps://idenGty.x.com/xidenGty/resources/profile/me"), urlencode(CALLBACK_URL), KEY); //forward user to PayPal auth page header("LocaGon: $auth_url"); ?> -
PayPal Access: Obtaining the Access Token <?php require_once
"common.php"; //capture code from auth $code = $_GET["code"]; //construct POST object for access token fetch request $postvals = sprinb("client_id=%s&client_secret= %s&grant_type=authorizaGon_code&code=%s&redirect_uri=%s", KEY, SECRET, $code, urlencode(CALLBACK_URL)); //get JSON access token object $token = json_decode(run_curl(ACCESS_TOKEN_ENDPOINT, 'POST', $postvals)); -
PayPal Access: Using the Access Token //construct URI to
fetch profile informaGon for current user $profile_url = sprinb("%s?oauth_token=%s", PROFILE_ENDPOINT, $token-‐>access_token); //fetch profile of current user $profile = run_curl($profile_url); var_dump($profile); ?> -
h;p://www.x.com h;p://slideshare.net/jcleblanc The FoundaGons of Human IdenGty
Tribalism and Social Grouping Experimental IdenGty Methods The Big Bag of Social IdenGty Fail What We’re Going to Cover -
h;p://www.x.com h;p://slideshare.net/jcleblanc Tribalism started as a way to
keep us safe …it has lead to some horrible parts of history but it is also a foundaGon of many of our social relaGonships Social Grouping: Founda0on in Tribalism -
h;p://www.x.com h;p://slideshare.net/jcleblanc Social Grouping: Group Types Follower
Type ConnecGon Type Group Type -
h;p://www.x.com h;p://slideshare.net/jcleblanc • Use all URLs from the
previous program. • Obtain content category for page. • Categorize user interest. Social Grouping: Group Programming Primer Program Overview -
h;p://www.x.com h;p://slideshare.net/jcleblanc Social Grouping: Group Programming Primer
Step 1: Obtain Website Content -
h;p://www.x.com h;p://slideshare.net/jcleblanc Social Grouping: Group Programming Primer
Step 2: Perform Keyword Density Search -
h;p://www.x.com h;p://slideshare.net/jcleblanc Social Grouping: Group Programming Primer
Step 3: Weight Keywords -
h;p://www.x.com h;p://slideshare.net/jcleblanc The FoundaGons of Human IdenGty
Tribalism and Social Grouping Experimental Iden0ty Methods The Big Bag of Social IdenGty Fail What We’re Going to Cover -
h;p://www.x.com h;p://slideshare.net/jcleblanc Step 1: Perform Discovery
curl h;ps://gmail.com/.well-‐known/host-‐meta Experimental Iden0ty: WebFinger -
h;p://www.x.com h;p://slideshare.net/jcleblanc Experimental Iden0ty: 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> -
h;p://www.x.com h;p://slideshare.net/jcleblanc Step 2: Collect User Data
curl h;p://www.google.com/s2/webfinger/? [email protected] Experimental Iden0ty: WebFinger -
h;p://www.x.com h;p://slideshare.net/jcleblanc User Profile h;p://www.google.com/profiles/nakedtechnologist Portable
Contacts h;p://www-‐opensocial.googleusercontent.com/api/ people/118167121283215553793/ Experimental Iden0ty: WebFinger -
h;p://www.x.com h;p://slideshare.net/jcleblanc profileUrl id thumbnail url
urls photos Experimental Iden0ty: WebFinger name forma;ed family name given name display name -
h;p://www.x.com h;p://slideshare.net/jcleblanc 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> Experimental Iden0ty: BrowserID -
h;p://www.x.com h;p://slideshare.net/jcleblanc Experimental Iden0ty: BrowserID navigator.id.get(func0on(asserGon)
{ if (asserGon) { $.ajax({ url: 'h;ps://browserid.org/verify', type: 'POST', data: 'asserGon='+asserGon+'&audience=jcleblanc.com', success: func0on(res) { console.log(res); } }); }); -
h;p://www.x.com h;p://slideshare.net/jcleblanc { audience:
"jcleblanc.com", email: "[email protected]", expires: 1320081400987, issuer: "browserid.org", status: "okay" } Experimental Iden0ty: BrowserID Results -
h;p://www.x.com h;p://slideshare.net/jcleblanc The FoundaGons of Human IdenGty
Tribalism and Social Grouping Experimental IdenGty Methods The Big Bag of Social Iden0ty Fail What We’re Going to Cover -
h;p://www.x.com h;p://slideshare.net/jcleblanc “My privacy concerns are
not trite. They are linked to my actual physical safety” -‐-‐Harriet Jacobs (Gizmodo) Social Iden0ty Fail: Personal Safety When Social Discovery Impacts Personal Safety -
h;p://www.x.com h;p://slideshare.net/jcleblanc “Path Uploads Your EnGre
iPhone Contact List By Default” -‐-‐Mark Hachman (PCMag) Social Iden0ty Fail: Privacy Concerns When Making Things Easy Impairs Privacy -
h;p://www.x.com h;p://slideshare.net/jcleblanc “How Target Figured Out
A Teen Girl Was Pregnant Before Her Father Did” -‐-‐Kashmir Hill (Forbes) Social Iden0ty Fail: The Fine Line The Fine Line Between Insighbul and Creepy -
h;p://www.x.com h;p://slideshare.net/jcleblanc IdenGty is more than just a
login AuthenGcaGon is just the first step Find the tool that: – Has the raw data that you need – Works with your business Iden0ty Programming Core Concepts -
hgp://slidesha.re/convergese_id Thanks! Any Ques0ons? Jonathan LeBlanc Developer
Evangelist: X.commerce Twi;er: @jcleblanc E-‐Mail: [email protected] Github: github.com/jcleblanc