Uysdug apr2013 enabling res tful services for mobile customer portal users

Post on 05-Dec-2014

140 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

DESCRIPTION

 

Transcript

Salesforce Mobile Developer WeekEnabling RESTful services for Mobile Customer Portal Users

Uruguay Salesforce DUG

Aldo FernandezSoftware Engineer@aldoforce

Bruno FagundezCloud Hacker@geekymartian

Supporters

Join the conversation: #uysdug #salesforcemobile

ConsultingCloud.com

DisclaimerContent and comments from the following presentation are purely and solely the responsibility of the speakers and do not reflect in any way or involve the thought of: Salesforce.com, Uruguay Salesforce Developer User Group or any other person involved in the organization of the event.The images, diagrams and texts from other authors cited were properly authorized.

Join the conversation: #uysdug #salesforcemobile

Speakers

Join the conversation: #uysdug #salesforcemobile

Aldo FernandezSoftware Engineer

@aldoforce

Bruno FagundezCloud Hacker

@geekymartian

Follow UYSDUG for the latest news

@uysdug / #uysdug

/Uruguay-Salesforce-Developer-User-Group/

www.uysdug.com

Join the conversation: #uysdug #salesforcemobile

Join the conversation: #uysdug #salesforcemobile

Salesforce Mobile Developer WeekWorldwide Developer Gathering - April 21-27, 2013

Join the conversation: #uysdug #salesforcemobile

Mobile PacksBuild Mobile web and hybrid apps using the language and frameworks you

already know and love.

Developing mobile apps to our Users

Join the conversation: #uysdug #salesforcemobile

Authenticate and consume REST services

Standard Objects

Custom Objects

About our Users, we already know...

Join the conversation: #uysdug #salesforcemobile

● License type: Salesforce or Salesforce Platform in most cases

● They are mobile● They can authenticate to Salesforce using

web login, SOAP API, REST API, etc.● Mainly they do CRUD operations against

Standard and Custom Objects

BUT, what if we want to...

Join the conversation: #uysdug #salesforcemobile

● Allow external Customers to use and interact with our standard/custom objects?

● Create a mobile app with engaging content, a great UX, in order to make your Customers part of your business community?

CUSTOMER PORTAL(flashing lights and confetti here!)

About our Customer Portal Users, we know...

Join the conversation: #uysdug #salesforcemobile

● They use Customer Portal Licenses● They can register/sign-up using the

Customer Portal Web site● They can authenticate using Portal web login

and SOAP API● They are Mobile

Regular Users vs Customer Portal Users

● License type: Salesforce

or Salesforce Platform

● CRUD operations

● Mobile

● Authentication

○ Web Login

○ SOAP API

○ REST API

● License type: Customer

Portal User

● CRUD operations

● Mobile

● Authentication

○ Portal Login

○ SOAP API*

*Special header settings required

Join the conversation: #uysdug #salesforcemobile

REST?

Ok, that's easy... right?

Join the conversation: #uysdug #salesforcemobile

● If you try to setup an OAuth authentication process with a user with Customer Portal License...

OAuth and Customer Portal Licenses

Join the conversation: #uysdug #salesforcemobile

● Currently (April 2013), using OAuth with Customer Portal License does not work.

● According to insider information, when Salesforce launch Chatter Communities as GA, OAuth will be available for Portal Users

● So, for the time being...

Insert hack HERE

Join the conversation: #uysdug #salesforcemobile

Enabling RESTful services to Mobile Customer Portal Users

Join the conversation: #uysdug #salesforcemobile

● First, Customer needs to authenticate using SOAP API.

● SOAP API was updated to additionally provide OrgID and PortalID attributes.

● After authentication the platform will provide a SessionID token.

● Save that SessionID

Enabling RESTful services to Mobile Customer Portal Users

Join the conversation: #uysdug #salesforcemobile

● Include that SessionID in the forthcoming REST requests' Authentication header:

Authentication: Bearer SessionID

● Submit that request and enjoy a RESTful experience... from your Mobile!

Demo Implementation

Join the conversation: #uysdug #salesforcemobile

● Use a Customer Portal● Publish VF ApexPages as REST endpoints● Make those endpoints to return JSONP

callbacks to avoid XSS policy● Request /login and /register pages passing

user parameters (USE HTTPS!)● Implement Mobile client to orchestrate the

process.

Join the conversation: #uysdug #salesforcemobile

Demo

Join the conversation: #uysdug #salesforcemobile

Q&A

Join the conversation: #uysdug #salesforcemobile

Aldo FernandezSoftware Engineer

@aldoforce

Bruno FagundezCloud Hacker

@geekymartian

Salesforce Mobile Developer WeekEnabling RESTful services for Mobile Customer Portal Users

Uruguay Salesforce DUG

Aldo FernandezSoftware Engineer@aldoforce

Bruno FagundezCloud Hacker@geekymartian

Thank you!

top related