SlideShare a Scribd company logo
1 of 13
 Facebook is a social networking website
launched in February 2004. A user must
register before they can use Facebook. After
registering users can create a user profile,
add other users as friends, exchange
messages, post status updates and photos,
share videos and receive notifications when
others update their profiles. In this blog post,
a step by step process of integrating with
Facebook using Mule ESB Facebook connector
is shown.
 In this blog post, we are using
◦ Facebook Connector 2.3.4
◦ Anypoint Studio
◦ Mule ESB Server 3.5.2
 To use this application in the project, we will
need a Facebook account for testing
 We need to create a new Facebook app under
Facebook developer apps to be able to
communicate with the Facebook account from
Mule ESB application
 We will be using OAuth2 authentication to
connect to Facebook using Mule ESB Facebook
Connector
 Go to https://developers.facebook.com/
 Click on My Apps
 Click on Create a New App button
 Add a unique display name, namespace and
select a category
 Click on Create App Id
 Click on Show button and make a note of the
App ID and App Secret. The App ID and App
Secret will be used later in Mule Facebook
Connector configuration
 Create a new Mule Application
 Click on Global Elements tab in your main flow
 Click on Create Button
 Select Facebook under connector configuration group
 Add Facebook App ID value to consumer key text box
 Add Facebook secret key value to consumer secret
text box
 Leave the scope text box empty. The default value for
scope is “email,read_stream,publish_stream” which
covers most of the access permissions
 Click on Oauth tab and specify domain, local port and
remote port values.
 <facebook:config-with-oauth name="Facebo
ok"
 consumerKey="${ConsumerKey}" consumerS
ecret="${ConsumerSecret}"
 doc:name="Facebook">
 <facebook:oauth-callback-config domain="l
ocalhost"
 localPort="1100" remotePort="1100" />
 </facebook:config-with-oauth>
 Configure a flow as shown below
 <flow name="AutorizeFacebook" doc:name="AutorizeFacebook">
 <http:inbound-endpoint exchange-pattern="request-response"
 host="localhost" port="5555" doc:name="HTTP" path="facebookupdate
" />
 <facebook:authorize config-ref="Facebook" doc:name="Authorize" />
 <choice doc:name="Choice">
 <when expression="flowVars.OAuthAccessTokenId != null">
 <logger message="Authorization Successful" level="INFO"
 doc:name="Logger" />
 <set-payload value="Facebook Authorization Successful"
 doc:name="Set Payload" />
 </when>
 <otherwise>
 <logger message="Authorization Failed" level="INFO" doc:name="Logg
er" />
 <set-payload value="Facebook Authorization Failed"
 doc:name="Set Payload" />
 </otherwise>
 </choice>
 </flow>
 If the app authorizes in to Facebook
successfully, the connector returns two flow
variables to Mule ESB flow which are
“_oauthVerifier” and “OAuthAccessTokenId”
 Using Choice router, we can check whether
the flow received an “OAuthAccessTokenId”
or not and based on the response we would
be able to determine the success or failure of
the Facebook authorization.
 Deploy the app
 Hit the following URL on the browser
 http://localhost:1111/facebookauthorize
 Facebook will ask us to authorize the new app to
connect to Facebook. This authorization will be
needed only on the first time when running the
application.
 Click on Okay button and we should see a message
on the browser as “Facebook Authorization
Successful”
 In order to publish or post a message on Facebook,
we will need to submit the app for review and request
for “publish_stream” access on developer app.

More Related Content

More from sivachandra mandalapu (20)

Defining global exception strategies
Defining global exception strategiesDefining global exception strategies
Defining global exception strategies
 
Reference exception strategy
Reference exception strategyReference exception strategy
Reference exception strategy
 
Validate json schema
Validate json schemaValidate json schema
Validate json schema
 
Validation
ValidationValidation
Validation
 
Property place holder
Property place holderProperty place holder
Property place holder
 
Collection aggregator
Collection aggregatorCollection aggregator
Collection aggregator
 
Cloud hub deployment
Cloud hub deploymentCloud hub deployment
Cloud hub deployment
 
Securing api with_o_auth2
Securing api with_o_auth2Securing api with_o_auth2
Securing api with_o_auth2
 
Deployment options for mule applications
Deployment options for mule applicationsDeployment options for mule applications
Deployment options for mule applications
 
Setting up organization with api access
Setting up organization with api accessSetting up organization with api access
Setting up organization with api access
 
API gateway setup
API gateway setupAPI gateway setup
API gateway setup
 
Splitter
SplitterSplitter
Splitter
 
Expression
ExpressionExpression
Expression
 
Bean as Datasource
Bean as DatasourceBean as Datasource
Bean as Datasource
 
Synchronous communication using jms back channel
Synchronous communication using jms back channelSynchronous communication using jms back channel
Synchronous communication using jms back channel
 
Sap
SapSap
Sap
 
Salesforce
SalesforceSalesforce
Salesforce
 
Data Mapper
Data MapperData Mapper
Data Mapper
 
Wildcard Filter
Wildcard FilterWildcard Filter
Wildcard Filter
 
Soap Component
Soap ComponentSoap Component
Soap Component
 

Recently uploaded

ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 

Recently uploaded (20)

ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 

Integration with facebook using mule esb

  • 1.
  • 2.  Facebook is a social networking website launched in February 2004. A user must register before they can use Facebook. After registering users can create a user profile, add other users as friends, exchange messages, post status updates and photos, share videos and receive notifications when others update their profiles. In this blog post, a step by step process of integrating with Facebook using Mule ESB Facebook connector is shown.
  • 3.  In this blog post, we are using ◦ Facebook Connector 2.3.4 ◦ Anypoint Studio ◦ Mule ESB Server 3.5.2  To use this application in the project, we will need a Facebook account for testing  We need to create a new Facebook app under Facebook developer apps to be able to communicate with the Facebook account from Mule ESB application  We will be using OAuth2 authentication to connect to Facebook using Mule ESB Facebook Connector
  • 4.  Go to https://developers.facebook.com/  Click on My Apps  Click on Create a New App button  Add a unique display name, namespace and select a category  Click on Create App Id  Click on Show button and make a note of the App ID and App Secret. The App ID and App Secret will be used later in Mule Facebook Connector configuration
  • 5.
  • 6.
  • 7.  Create a new Mule Application  Click on Global Elements tab in your main flow  Click on Create Button  Select Facebook under connector configuration group  Add Facebook App ID value to consumer key text box  Add Facebook secret key value to consumer secret text box  Leave the scope text box empty. The default value for scope is “email,read_stream,publish_stream” which covers most of the access permissions  Click on Oauth tab and specify domain, local port and remote port values.
  • 8.
  • 9.  <facebook:config-with-oauth name="Facebo ok"  consumerKey="${ConsumerKey}" consumerS ecret="${ConsumerSecret}"  doc:name="Facebook">  <facebook:oauth-callback-config domain="l ocalhost"  localPort="1100" remotePort="1100" />  </facebook:config-with-oauth>
  • 10.  Configure a flow as shown below
  • 11.  <flow name="AutorizeFacebook" doc:name="AutorizeFacebook">  <http:inbound-endpoint exchange-pattern="request-response"  host="localhost" port="5555" doc:name="HTTP" path="facebookupdate " />  <facebook:authorize config-ref="Facebook" doc:name="Authorize" />  <choice doc:name="Choice">  <when expression="flowVars.OAuthAccessTokenId != null">  <logger message="Authorization Successful" level="INFO"  doc:name="Logger" />  <set-payload value="Facebook Authorization Successful"  doc:name="Set Payload" />  </when>  <otherwise>  <logger message="Authorization Failed" level="INFO" doc:name="Logg er" />  <set-payload value="Facebook Authorization Failed"  doc:name="Set Payload" />  </otherwise>  </choice>  </flow>
  • 12.  If the app authorizes in to Facebook successfully, the connector returns two flow variables to Mule ESB flow which are “_oauthVerifier” and “OAuthAccessTokenId”  Using Choice router, we can check whether the flow received an “OAuthAccessTokenId” or not and based on the response we would be able to determine the success or failure of the Facebook authorization.
  • 13.  Deploy the app  Hit the following URL on the browser  http://localhost:1111/facebookauthorize  Facebook will ask us to authorize the new app to connect to Facebook. This authorization will be needed only on the first time when running the application.  Click on Okay button and we should see a message on the browser as “Facebook Authorization Successful”  In order to publish or post a message on Facebook, we will need to submit the app for review and request for “publish_stream” access on developer app.