{"__v":28,"_id":"5514c7c207274c0d00e620fd","category":{"__v":6,"_id":"5514c6e9bc466623002afddb","pages":["5514c714fd18c60d00fd21cc","5514c71b07274c0d00e620f5","5514c72707274c0d00e620f7","5514c7c207274c0d00e620fd","5514c7dafa9cbe2300847846","5514c7e9bc466623002afde0"],"project":"551375e1d04af219007ddc52","version":"551375e2d04af219007ddc55","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-03-27T02:56:41.497Z","from_sync":false,"order":2,"slug":"authenticating-users","title":"Authenticating Users"},"project":"551375e1d04af219007ddc52","user":"551375a3d04af219007ddc50","version":{"__v":9,"_id":"551375e2d04af219007ddc55","project":"551375e1d04af219007ddc52","createdAt":"2015-03-26T02:58:42.261Z","releaseDate":"2015-03-26T02:58:42.260Z","categories":["551375e2d04af219007ddc56","5514c6e9bc466623002afddb","5514c6f8fa9cbe2300847841","5514c6fd07274c0d00e620f4","553fe5fc23c53c0d00ccceb4","554113ad5cf9682100d61baa","5549346a6a82a10d00817a81","561be536a3df620d007a1851","563aef87ea247f0d0044d4de"],"is_deprecated":true,"is_hidden":false,"is_beta":false,"is_stable":false,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-03-27T03:00:18.864Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"Human Connect is the authentication widget you embed into your website or application to allow your users to share their health data with your apps and services. After a user has successfully granted you access to their health data using Human Connect, you'll be able to query their data directly from Human API.\n\nAdditionally, after the authentication process each user from your app will have an unique Human API account, which will automatically synchronize all of a user's health data from their disparate data sources.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/cb7xrYZIRIau2o8L8U08_Connect.png\",\n        \"Connect.png\",\n        \"879\",\n        \"800\",\n        \"#1c94d4\",\n        \"\"\n      ],\n      \"caption\": \"Connect popup\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Authentication Flow Overview\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/l6BIcVLKQxaOvRKGtCEo_auth-flow.png\",\n        \"auth-flow.png\",\n        \"800\",\n        \"590\",\n        \"#1c6bb4\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\n#The Human Connect authentication flow consists of 6 steps:\n\n1. Launch the Connect popup with two configuration parameters: `clientId` and `clientUserId`.\n\n2. Once a user has connected their data sources and presses the \"Done\" button, you will receive a `sessionTokenObject`.\n\n3. Post this `sessionTokenObject` to your server.\n\n4. On your server, add your unique `clientSecret` to the `sessionTokenObject` and POST it to Human API's servers.\n\n5. Human API will return: `humanId`, `accessToken`, and `publicToken`. Save this data in your system with the appropriate user model.\n\n6. Update your app status. You can now start using Human API for querying data.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Key Data Points\"\n}\n[/block]\n\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Key\",\n    \"h-1\": \"Use\",\n    \"0-0\": \"**`humanId`**\",\n    \"1-0\": \"**`accessToken`**\",\n    \"2-0\": \"**`publicToken`**\",\n    \"2-1\": \"Used to open the Human Connect popup for existing users.\",\n    \"1-1\": \"Used to pull all data for a user.\",\n    \"h-2\": \"Remarks\",\n    \"1-2\": \"This token does not expire.\",\n    \"2-2\": \"For a new publicToken, ping the publicToken endpoint.\",\n    \"0-1\": \"User ID within Human API.\",\n    \"0-2\": \"Store this with your local user model.\",\n    \"3-0\": \"`clientId`\",\n    \"4-0\": \"`clientSecret`\",\n    \"5-0\": \"`sessionTokenObject`\",\n    \"3-1\": \"Unique ID of your Human API app. Found on the app settings page of the Developer Portal.\",\n    \"4-1\": \"Unique client secret of your Human API app. Found on the app settings page of the Developer Portal.\",\n    \"5-1\": \"Consists of a `humanId`, `clientId`, and `sessionToken`.\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"**Bold parameters** should be stored securely with your local user model.\"\n}\n[/block]","excerpt":"Human Connect is the easiest way to connect your users' health data with your application or service.","slug":"overview-of-human-connect","type":"basic","title":"Overview of Human Connect"}

Overview of Human Connect

Human Connect is the easiest way to connect your users' health data with your application or service.

Human Connect is the authentication widget you embed into your website or application to allow your users to share their health data with your apps and services. After a user has successfully granted you access to their health data using Human Connect, you'll be able to query their data directly from Human API. Additionally, after the authentication process each user from your app will have an unique Human API account, which will automatically synchronize all of a user's health data from their disparate data sources. [block:image] { "images": [ { "image": [ "https://files.readme.io/cb7xrYZIRIau2o8L8U08_Connect.png", "Connect.png", "879", "800", "#1c94d4", "" ], "caption": "Connect popup" } ] } [/block] [block:api-header] { "type": "basic", "title": "Authentication Flow Overview" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/l6BIcVLKQxaOvRKGtCEo_auth-flow.png", "auth-flow.png", "800", "590", "#1c6bb4", "" ] } ] } [/block] #The Human Connect authentication flow consists of 6 steps: 1. Launch the Connect popup with two configuration parameters: `clientId` and `clientUserId`. 2. Once a user has connected their data sources and presses the "Done" button, you will receive a `sessionTokenObject`. 3. Post this `sessionTokenObject` to your server. 4. On your server, add your unique `clientSecret` to the `sessionTokenObject` and POST it to Human API's servers. 5. Human API will return: `humanId`, `accessToken`, and `publicToken`. Save this data in your system with the appropriate user model. 6. Update your app status. You can now start using Human API for querying data. [block:api-header] { "type": "basic", "title": "Key Data Points" } [/block] [block:parameters] { "data": { "h-0": "Key", "h-1": "Use", "0-0": "**`humanId`**", "1-0": "**`accessToken`**", "2-0": "**`publicToken`**", "2-1": "Used to open the Human Connect popup for existing users.", "1-1": "Used to pull all data for a user.", "h-2": "Remarks", "1-2": "This token does not expire.", "2-2": "For a new publicToken, ping the publicToken endpoint.", "0-1": "User ID within Human API.", "0-2": "Store this with your local user model.", "3-0": "`clientId`", "4-0": "`clientSecret`", "5-0": "`sessionTokenObject`", "3-1": "Unique ID of your Human API app. Found on the app settings page of the Developer Portal.", "4-1": "Unique client secret of your Human API app. Found on the app settings page of the Developer Portal.", "5-1": "Consists of a `humanId`, `clientId`, and `sessionToken`." }, "cols": 2, "rows": 6 } [/block] [block:callout] { "type": "info", "body": "**Bold parameters** should be stored securely with your local user model." } [/block]