Uysdug apr2013 enabling res tful services for mobile customer portal users

22
Salesforce Mobile Developer Week Enabling RESTful services for Mobile Customer Portal Users Uruguay Salesforce DUG Aldo Fernandez Software Engineer @aldoforce Bruno Fagundez Cloud Hacker @geekymartian

description

 

Transcript of Uysdug apr2013 enabling res tful services for mobile customer portal users

Page 1: Uysdug apr2013   enabling res tful services for mobile customer portal users

Salesforce Mobile Developer WeekEnabling RESTful services for Mobile Customer Portal Users

Uruguay Salesforce DUG

Aldo FernandezSoftware Engineer@aldoforce

Bruno FagundezCloud Hacker@geekymartian

Page 2: Uysdug apr2013   enabling res tful services for mobile customer portal users

Supporters

Join the conversation: #uysdug #salesforcemobile

ConsultingCloud.com

Page 3: Uysdug apr2013   enabling res tful services for mobile customer portal users

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

Page 4: Uysdug apr2013   enabling res tful services for mobile customer portal users

Speakers

Join the conversation: #uysdug #salesforcemobile

Aldo FernandezSoftware Engineer

@aldoforce

Bruno FagundezCloud Hacker

@geekymartian

Page 5: Uysdug apr2013   enabling res tful services for mobile customer portal users

Follow UYSDUG for the latest news

@uysdug / #uysdug

/Uruguay-Salesforce-Developer-User-Group/

www.uysdug.com

Join the conversation: #uysdug #salesforcemobile

Page 6: Uysdug apr2013   enabling res tful services for mobile customer portal users

Join the conversation: #uysdug #salesforcemobile

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

Page 7: Uysdug apr2013   enabling res tful services for mobile customer portal users

Join the conversation: #uysdug #salesforcemobile

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

already know and love.

Page 8: Uysdug apr2013   enabling res tful services for mobile customer portal users

Developing mobile apps to our Users

Join the conversation: #uysdug #salesforcemobile

Authenticate and consume REST services

Standard Objects

Custom Objects

Page 9: Uysdug apr2013   enabling res tful services for mobile customer portal users

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

Page 10: Uysdug apr2013   enabling res tful services for mobile customer portal users

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!)

Page 11: Uysdug apr2013   enabling res tful services for mobile customer portal users

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

Page 12: Uysdug apr2013   enabling res tful services for mobile customer portal users

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?

Page 13: Uysdug apr2013   enabling res tful services for mobile customer portal users

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...

Page 14: Uysdug apr2013   enabling res tful services for mobile customer portal users

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...

Page 15: Uysdug apr2013   enabling res tful services for mobile customer portal users

Insert hack HERE

Join the conversation: #uysdug #salesforcemobile

Page 16: Uysdug apr2013   enabling res tful services for mobile customer portal users

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

Page 17: Uysdug apr2013   enabling res tful services for mobile customer portal users

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!

Page 18: Uysdug apr2013   enabling res tful services for mobile customer portal users

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.

Page 19: Uysdug apr2013   enabling res tful services for mobile customer portal users

Join the conversation: #uysdug #salesforcemobile

Page 20: Uysdug apr2013   enabling res tful services for mobile customer portal users

Demo

Join the conversation: #uysdug #salesforcemobile

Page 21: Uysdug apr2013   enabling res tful services for mobile customer portal users

Q&A

Join the conversation: #uysdug #salesforcemobile

Aldo FernandezSoftware Engineer

@aldoforce

Bruno FagundezCloud Hacker

@geekymartian

Page 22: Uysdug apr2013   enabling res tful services for mobile customer portal users

Salesforce Mobile Developer WeekEnabling RESTful services for Mobile Customer Portal Users

Uruguay Salesforce DUG

Aldo FernandezSoftware Engineer@aldoforce

Bruno FagundezCloud Hacker@geekymartian

Thank you!