Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Rest + Oauth Integration by Lightning By Mohammed Rizwan


Published on

Rest and Oauth integration using Lightning

Published in: Software
  • Be the first to comment

  • Be the first to like this

Rest + Oauth Integration by Lightning By Mohammed Rizwan

  1. 1. @sfdgblr #blrdevx #
  2. 2. Mohammed Rizwan Sr. SDE @rizwanakhtar08 REST + OAuth Integration in Lightning
  3. 3. Thank You Sponsors! @sfdgblr #blrdevx Diamond Sponsor Gold Sponsor
  4. 4. @sfdgblr #blrdevx Index • What & Why of Integration • All about REST • Types of authentications • OAuth & it’s versions • Demo • Coding practices • Mock class use cases • Error handling • Q&A
  5. 5. @sfdgblr #blrdevx What & Why of Integration • In todays’ world, every company uses different systems for different tasks • Data remains in silos and affects efficient decision making • Integration helps in bringing data from all all sources into one System, which then acts as the Source of Truth. • Helps in decision making • There is hardly any argument on the fact that APIs are increasingly becoming an important part of how companies do business. API has become the de facto standard to unlock one of their most valuable resources, data [MuleSoft Blog]
  6. 6. @sfdgblr #blrdevx All about REST • RESTful API design was defined by Dr. Roy Fielding. In order to be a true RESTful API, a web service must adhere to the following six REST architectural constraints: • Use of a uniform interface [GET,PUT, POST, DELETE, etc..] • Client-Server based • Stateless operation • Resource Caching • Layered System • Code on Demand
  7. 7. @sfdgblr #blrdevx Types of Authentication • Username + password based • Token based • SSO based • Oauth based • And few others….
  8. 8. @sfdgblr #blrdevx Are you familiar with these images??
  9. 9. @sfdgblr #blrdevx Are you familiar with these images??
  10. 10. @sfdgblr #blrdevx Are you familiar with these images??
  11. 11. @sfdgblr #blrdevx OAuth • There are 3 Components in OAuth Mechanism– • OAuth Provider – This is the OAuth provider Eg. Google, Facebook etc. • OAuth Client – This is the website where we are sharing or authenticating the usage of our information. Eg. Salesforce, Zomato, Uber, StackOverflow, Salesforce • Owner – The user whose login authenticates sharing of information [Source]
  12. 12. @sfdgblr #blrdevx OAuth flows [Source]
  13. 13. @sfdgblr #blrdevx OAuth Authorization code flow
  14. 14. @sfdgblr #blrdevx
  15. 15. @sfdgblr #blrdevx Coding Practices • Modular functions • Focus on reducing LOC in the org • Code reusability means faster development and deployment cycle • Following uniform coding conventions
  16. 16. @sfdgblr #blrdevx Mock class use cases • Either implement HttpCalloutMock or use (Multi)StaticResourceCalloutMock • Focus on Code reusability • Handling multiple callouts using Generic Mock classes [demo] • Providing room for multiple levels of success & error handling
  17. 17. @sfdgblr #blrdevx Error handling • Make programs robust and always provide a message to end user • Approach to persist errors for future troubleshooting • Handling failures at every level of callout and response parsing
  18. 18. @sfdgblr #blrdevx GAME TIME
  19. 19. @sfdgblr #blrdevx Q&A Or scan this to reach out to me