Skip to content
Markus Sabadello edited this page Jan 27, 2015 · 20 revisions

This is a description and walkthrough for the connector plugin for the XDI2 server that maps data from Facebook to XDI.

Scenario

This is a connector plugin for the XDI2 server. It can map personal data from the Facebook Graph API to XDI. This personal data can subsequently be integrated with all features and applications of XDI such as link contracts, $ref relations, cloud cards, etc.

Sequence Diagram 1

This diagram shows how a user can authorize an XDI2 Server to access a Facebook account. This involves a standard OAuth 2.0 redirection sequence (Authorization Code Grant) to obtain an access token, which is then stored in the user's XDI graph for later use.

websequencediagrams-obtaining-facebook-oauth-access-token.png

Source: websequencediagrams-obtaining-facebook-oauth-access-token.txt

Sequence Diagram 2

This diagram shows what happens when an XDI client makes a request to a part of the user's graph that maps to personal data in a Facebook account. For this to work, the OAuth 2.0 access token is needed, i.e. Sequence 1 must have been completed first.

websequencediagrams-xdi-get-request-handled-by-facebookcontributor.png

Source: websequencediagrams-xdi-get-request-handled-by-facebookcontributor.txt

Walkthrough

Step 1: blabla step 1

more blabla


Step 2: blabla step 2

more blabla

This is an example XDI $add message that can be used to store an OAuth access token in a user's XDI graph:

=!1111$($msg)$(!1)/$is()/(=!1111)
=!1111$($msg)$(!1)/$do/$do
=!1111$($msg)$(!1)$secret$!($token)/!/(data:,s3cret)
=!1111$($msg)$(!1)$do/$add/(+(https://facebook.com/)=!1111$oauth$!(+token)/!/(data:,<oauth-access-token-here>))

Step 3: blabla step 3

more blabla


Step 4: blabla step 4

more blabla


Step 5: blabla step 5

more blabla


Step 6: blabla step 6

more blabla


Step 7: The cloud card viewed by a visitor on the web.

In this case, all attributes are public, i.e. can be viewed without a link contract. If they were private, an XDI Connect flow would be needed to initiate a connection request to the cloud card.

Depending on whether $ref or $rep equivalence links are used in the graph, the fact that personal data on the cloud card comes from Facebook may or may not be visible by an XDI client.


Step 8: The cloud card may also be viewed by the XDI Ninja! browser plugin.

Since the XDI Ninja! browser plugin periodically checks cloud cards for updates, a popup window would appear if a Facebook attribute in the cloud card changes.

Clone this wiki locally