17

Chak Nanga (Architect)

  • Upload
    seda

  • View
    70

  • Download
    0

Embed Size (px)

DESCRIPTION

Building Apps With MySpace SDKs. Chak Nanga (Architect). Introduction. SDKs support "on-site" and "off-site" app development "On-Site"/ OpenSocial Applications (Canvas View) OpenSocial app’s canvas view hosted on your server Written using a language/framework of your choice - PowerPoint PPT Presentation

Citation preview

Page 1: Chak  Nanga (Architect)
Page 2: Chak  Nanga (Architect)

Chak Nanga (Architect)

Building Apps With MySpace SDKs

Page 3: Chak  Nanga (Architect)

Introduction

• SDKs support "on-site" and "off-site" app development

• "On-Site"/OpenSocial Applications (Canvas View)– OpenSocial app’s canvas view hosted on your server– Written using a language/framework of your choice– App logic hosted on your servers and displayed on MySpace in an IFrame

• "Off-Site”/MySpaceID Applications– Apps/Services that leverage MySpace social data outside MySpace– Written in a language/framework of your choice– Apps hosted on your servers

Page 4: Chak  Nanga (Architect)

MySpace SDKs Overview

• MySpace REST APIs are at the core of the SDKs

• SDKs provide a high level interface to the REST APIs

– High level APIs to get social data from MySpace (friends, profile etc.)

– Abstracts away the protocol details (OAuth signing)

• Available in multiple languages

– C#, Java, PHP, Python, Ruby

• Consistent interface across all the languages

• Open-sourced and hosted on google code

• Contributors are welcome!

Page 5: Chak  Nanga (Architect)

SDK Contents

• Core API library and dependent libraries (Oauth, OpenID etc)

• Samples for supported usage scenarios

– OAuth Delegated Access (“3-Legged” Oauth)

– OpenID + OAuth Hybrid

• Documentation

Page 6: Chak  Nanga (Architect)

Building an “on-site” application

• Choose the "External IFrame" radio button in the Canvas Surface tab

• Enter the IFrame URL in the text box

Page 7: Chak  Nanga (Architect)

Building an “on-site” application

• Canvas view rendered in an IFrame• Iframe “src” set to IFrame URL (signed request from

MySpace)• Verify signatures when request hits your servers• Extract user id from the request• Utilize the user id in the SDK calls

Page 8: Chak  Nanga (Architect)

On-Site App Demo / Code

Page 9: Chak  Nanga (Architect)

Building a MySpaceID application

Page 10: Chak  Nanga (Architect)

OAuth Delegated Access Demo

• Application steps– Get request token

– Redirect to authorization page (on MySpace)

– User approves application request

– MySpace redirects to the supplied callback URL

– Get access token

– Access social data using the SDK

Page 11: Chak  Nanga (Architect)

OAuth Delegated Access Code

• Get Request Token + Redirect to Service Provider

Page 12: Chak  Nanga (Architect)

OAuth Delegated Access Code

• Get Access Token (in the Service Provider callback)

Page 13: Chak  Nanga (Architect)

OAuth Delegated Access Code

• Access protected resources

Page 14: Chak  Nanga (Architect)

OpenID + OAuth “hybrid” Demo

• MySpace is a “Combined Provider” (OpenID Provider + OAuth Service Provider)

• OpenID OAuth extension (“hybrid”)– Combines authentication and authorization screen for two protocols– Better user experience

• Application steps– Use OpenID library to initiate authentication– Embed OAuth approval request into OpenID authentication request– Combined Provider returns approved request token– Combined Cosumer exchanges the request token for access token– Access social data using the SDK

Page 15: Chak  Nanga (Architect)

OpenID + OAuth “hybrid” Code

• Embed OAuth approval request

Page 16: Chak  Nanga (Architect)

OpenID + OAuth “hybrid” Code

• Exchange approved request token for access token• Access user data

Page 17: Chak  Nanga (Architect)

Thank You!

• Additional Information– http://developer.myspace.com/myspaceid/