Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Opensocial

Similar presentations


Presentation on theme: "Introduction to Opensocial"— Presentation transcript:

1 Introduction to Opensocial

2 Opensocial Architecture
Introduction to Opensocial Opensocial Architecture

3 OpenSocial OpenSocial is a  public specification that allows mini applications (Gadgets) to be built and embedded within a social network envionment (Container)

4 OpenSocial It was developed byGoogle along with MySpace and a number of other social networks OpenSocial Foundation has moved to integrate other open technologies: Oauth and OAuth 2.0, Activity Streams

5 Opensocial Containers

6 Opensocial architecture
The Request flow: Client Requests an application view Container sends social data to the remote server The remote server combines social and application data, returning HTML and JavaScript The container sends the content to the client

7 Introduction to Opensocial
OpenId

8 OpenID 參與者 facebook.net xyz.com John ,是一個人
社群服務網站,並且同時也是 OpenID 與 OAuth 的 Provider xyz.com 購物網站,且可使用 abc.net 所提供的 OpenID 與 OAuth 的服務 John ,是一個人 是 facebook.net 的長期使用者,他在 facebook.net 的使用記錄中,留下了許多偏好資訊,包含: 他的名片,記載了他的地址、聯絡方式、與公司職務等。 他的使用偏好,他習慣選擇中文使用介面,偏好藍色系佈景。 他的通訊錄與好友名單。

9 OpenID 使用情境 yourApp.com與facebook.net支援OpenID協定。John用同一個帳號,就可以登入這兩個網站
John想使用 yourApp.com 的服務。John登入 yourApp.com網站時,他的登入帳號可以輸入 yourApp.com 網站就會導引John回到facebook.net 的登入頁面,完成輸入密碼的動作之後,再回到 yourApp.com 的使用頁面。 OpenID provider 並不需要特定簽約 只要 yourApp.com願意接受 facebook.net的 OpenID, yourApp.com就可以使用 OpenID 登入。yourApp.com並不需要向 facebook.net簽約。

10 OAuth 使用情境 當John第一次登入 yourApp.com的使用頁面後, yourApp.com為了提供John更好的操作體驗,於是它可以透過 OAuth 從 facebook.net處取得John的使用偏好。 (再一次,John將被導引回 facebook.net的頁面,確認他是否要讓 yourApp.com取得他的使用偏好。這個確認動作,可能做一次後就會被記住而不會再問,也可能每次都問。這由 facebook.net的設計決定,讓John選擇。) John在 yourApp.com上訂購商品,yourApp.com透過 OAuth 向 facebook.net查詢他的隱私資訊 (地址與電話),而不需John自己填寫。

11 OAuth 使用情境 在這個資料查詢的過程中,John都不需要把他在 facebook.net的登入密碼告知 yourApp.com。
假設有一天, yourApp.com犯傻了,在John登入網站後,透過 OAuth 向facebook.net要John的某個影片檔。由於John並未允許 yourApp.com提取影片資料,所以 facebook.net就不會提供影片給 yourApp.com 。

12 OAuth Request Flow

13 OAuth 2.0

14 Facebook Permissions (權限)

15 Permissions: 用Graph API 取得token
第一步 取得所需要得權限acess token

16 Permissions: Graph API: Album
加入album ID?加入acess token

17 Graph API: FriendList 有些需先取得特別的權限,例如 FriendList, Group等等必須先取得特定權限的acess token friendlist ID?加入acess token

18 FQL and Permissions (1) <script> FB.login(function(response) { if (response.session) { if (response.perms) { // user has granted the permissions } else { // user is logged in, but did not grant the permissions } // user is not logged in }, {scope: 'read_friendlists'}); FB.api({ method: 'fql.multiquery', queries: { "query1": "SELECT flid, owner, name FROM friendlist WHERE owner=me()", "query2": "SELECT uid, flid FROM friendlist_member WHERE flid IN (SELECT flid FROM friendlist WHERE owner=me())" }, function(response) { Log.info('API Callback', response); ); </script>

19 FQL and Permissions (2) 可用此網站測試FQL


Download ppt "Introduction to Opensocial"

Similar presentations


Ads by Google