SlideShare a Scribd company logo
Deep Dive into Salesforce
Connected App - Part 2
@msrivastav13 | mohith.shrivastava@salesforce.com
Mohith Shrivastava, Lead Developer Evangelist
Forward-Looking Statement
Statement under the Private Securities Litigation Reform Act of 1995:
This presentation contains forward-looking statements about the company’s financial and operating results, which may include expected GAAP and non-GAAP financial and other operating
and non-operating results, including revenue, net income, diluted earnings per share, operating cash flow growth, operating margin improvement, expected revenue growth, expected
current remaining performance obligation growth, expected tax rates, the one-time accounting non-cash charge that was incurred in connection with the Salesforce.org combination; stock-
based compensation expenses, amortization of purchased intangibles, shares outstanding, market growth and sustainability goals. The achievement or success of the matters covered by
such forward-looking statements involves risks, uncertainties and assumptions. If any such risks or uncertainties materialize or if any of the assumptions prove incorrect, the company’s
results could differ materially from the results expressed or implied by the forward-looking statements we make.
The risks and uncertainties referred to above include -- but are not limited to -- risks associated with the effect of general economic and market conditions; the impact of geopolitical events;
the impact of foreign currency exchange rate and interest rate fluctuations on our results; our business strategy and our plan to build our business, including our strategy to be the leading
provider of enterprise cloud computing applications and platforms; the pace of change and innovation in enterprise cloud computing services; the seasonal nature of our sales cycles; the
competitive nature of the market in which we participate; our international expansion strategy; the demands on our personnel and infrastructure resulting from significant growth in our
customer base and operations, including as a result of acquisitions; our service performance and security, including the resources and costs required to avoid unanticipated downtime and
prevent, detect and remediate potential security breaches; the expenses associated with new data centers and third-party infrastructure providers; additional data center capacity; real estate
and office facilities space; our operating results and cash flows; new services and product features, including any efforts to expand our services beyond the CRM market; our strategy of
acquiring or making investments in complementary businesses, joint ventures, services, technologies and intellectual property rights; the performance and fair value of our investments in
complementary businesses through our strategic investment portfolio; our ability to realize the benefits from strategic partnerships, joint ventures and investments; the impact of future gains
or losses from our strategic investment portfolio, including gains or losses from overall market conditions that may affect the publicly traded companies within the company's strategic
investment portfolio; our ability to execute our business plans; our ability to successfully integrate acquired businesses and technologies, including delays related to the integration of
Tableau due to regulatory review by the United Kingdom Competition and Markets Authority; our ability to continue to grow unearned revenue and remaining performance obligation; our
ability to protect our intellectual property rights; our ability to develop our brands; our reliance on third-party hardware, software and platform providers; our dependency on the development
and maintenance of the infrastructure of the Internet; the
effect of evolving domestic and foreign government regulations, including those related to the provision of services on the Internet, those related to accessing the Internet, and those
addressing data privacy, cross-border data transfers and import and export controls; the valuation of our deferred tax assets and the release of related valuation allowances; the potential
availability of additional tax assets in the future; the impact of new accounting pronouncements and tax laws; uncertainties affecting our ability to estimate our tax
rate; the impact of expensing stock options and other equity awards; the sufficiency of our capital resources; factors related to our outstanding debt, revolving credit facility, term loan and
loan associated with 50 Fremont; compliance with our debt covenants and lease obligations; current and potential litigation involving us; and the impact of climate change.
Further information on these and other factors that could affect the company’s financial results is included in the reports on Forms 10-K, 10-Q and 8-K and in other filings it makes with the
Securities and Exchange Commission from time to time. These documents are available on the SEC Filings section of the Investor Information section of the company’s website at
www.salesforce.com/investor.
Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements, except as required by law.
Recap
● What is a Connected App?
● Authentication vs Authorization
● Single Sign-On(SSO), SAML 2.0
● Connected App Use Cases
● Demo - Created simple Connected app and covered web server oauth2 flow
● Connected App Developers vs Connected App Admins
● Key Considerations when deploying Connected Apps
● References
● Access Data with API Integration
● Integrate other Service Providers within your Salesforce org
● Manage Access to third party apps
● Provide Authorization For External API Gateways
Connected App Use Cases
https://sforce.co/33TTzY6
Agenda
● What is JWT tokens?
● JWT Structure
● How JWT tokens work?
● OAuth 2.0 JWT Bearer Flow for Server-to-Server Integration
● Demo
● References
JWT stands for JSON Web Tokens.
JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self-
contained way for securely transmitting information between parties as a JSON object.
Information can be verified and trusted because it is digitally signed.
JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using
RSA or ECDSA.
I
What is JWT?
It will look like below
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9.
TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ
<headerbase64encodedurl>. <claimsbase64encodedclaims>.<signature>
What is JWT ? cont...
● Header
● Payload
● Signature
JWT Structure
{
"alg": "HS256",
"typ": "JWT"
}
Header
The second part of the token is the payload, which contains the claims. Claims are statements
about an entity (typically, the user) and additional data. There are three types of claims:
registered, public, and private claims.
{
"sub": "1234567890",
"name": "TrailheadLive App",
"iat": 1516239022
}
Payload
HMACSHA256(
base64UrlEncode(header) + "." +
base64UrlEncode(payload),
secret)
Signature
How Does JWT Work?
Client Application
Authorization
Server(/v2/oauth2/token)
Resource
Server(Salesforce API)
2
1
3
1. The application requests
authorization to the Salesforce
authorization server.
2. Salesforce Authorization Server
on successful authorization
responds with an access token
3. Using access token the client
application can access the
Resource Server API
● Use this flow for Server to Server Integration.
● Note that you should pre approve the connected app once before you can use this flow.
● Salesforce requires that a JWT is signed using RSA SHA256, which uses an uploaded
certificate as the signing secret.
OAuth 2.0 JWT Bearer Flow for Server-to-Server Integration
Steps to create Valid JWT
{"alg":"RS256"} Encode the header
using
base64URLencode
{"iss": <consumer key
from connected app>,
"sub": <username>,
"aud":
"https://login.salesforc
e.com",
"exp":
<currenunixtime>
}
NOTE- This has to be
compact one line in
JSON
Encode the claims
using
base64URLencode
encoded_JWT_Header
+ "." +
encoded_JWT_Claims_
Set
Construct JWT
Header
base64URL
encode
Construct
JSON claims
Base64URLEncode
Claims
Encoded Header
and Claims
Steps to create Valid JWT contd..
Use openssl lib
for this
HMACSHA256(
base64UrlEncode(heade
r) + "." +
base64UrlEncode(paylo
ad),
secret)
<base6encoded
url>.
<base64encode
dclaims>.
<signature>
grant_type=
urn:ietf:params:oaut
h:grant-type:jwt-
bearer&
assertion=<jwt>
Create X509
Certificate
Sign the
encoded String
Construct
JWT token
Request access token
Debug using https://jwt.io
● Each X.509 certificate includes a public key, digital signature, and information about both the identity
associated with the certificate and its issuing certificate authority (CA)
● The public key is part of a key pair that also includes a private key. The private key is kept secure, and the
public key is included in the certificate.
Public/Private key Usage:
○ Allows the owner of the private key to digitally sign documents; these signatures can be verified by anyone with the
corresponding public key.
○ Allows third parties to send messages encrypted with the public key that only the owner of the private key can decrypt.
X.509 Certificate
Creating Connected Application
Demo
JWT via Apex
● Requires the certificate imported in JKS format.
● JWT, JWS and JWTBearerTokenExchange class under Auth Namespace simplifies
performing JWT Bearer Token flow
● Use openSSL to convert private key and certificate first to PKCS12
○ openssl pkcs12 -export -in server.crt -inkey serverkey.pem -out testkeystore.p12
● Use keytool to convert from PKCS12 to JKS, Remember to change alias so one can
import it into Salesforce
○ keytool -importkeystore -srckeystore testkeystore.p12 -srcstoretype pkcs12 -
destkeystore cert.jks -deststoretype JKS
○ keytool -keystore <keystorefilepath>/cert.jks -changealias -alias 1 -destalias
<NEW_ALIAS>
● Troubleshooting help articles if keystore import fails
■ https://help.salesforce.com/articleView?id=000338348
■ https://help.salesforce.com/articleView?id=000338720
Create JKS From Private Key and Public Certificate
Continuous Integration Using Salesforce DX
https://trailhead.salesforce.com/content/learn/modules/sfdx_travis_ci
Create a Private key and Self Signed Certificate Instructions
https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_key_and_cert.htm
Authorize Apps with OAuth - JWT flow
https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.htm&type=5
Connected Apps Basics Trailhead Module
https://trailhead.salesforce.com/en/content/learn/modules/connected-app-basics
Creating a Connected App Unit
https://trailhead.salesforce.com/en/content/learn/projects/build-a-connected-app-for-api-integration/create-a-connected-
app
Debug Using JWT.io
https://jwt.io
References
Deep dive into salesforce connected app - part 2

More Related Content

What's hot (20)

PPTX
Apply the Salesforce CLI To Everyday Problems
Peter Chittum
 
PPTX
LMS Lightning Message Service
Peter Chittum
 
PDF
If you can write a Salesforce Formula you can use the command line
Peter Chittum
 
PDF
Shadow DOM, CSS and Styling Hooks in LWC what you need to know
Sudipta Deb ☁
 
PDF
Winter '22 highlights
AtaullahKhan31
 
PDF
Women in Tech - Salesforce Debug Logs Deep Dive with Jess Lopez - March 2021
Alesia Dvorkina
 
PDF
Lightning User Interface Testing with Selenium and Node JS
Keir Bowden
 
PDF
Dreamforce Global Gathering
Sudipta Deb ☁
 
PDF
Demystifying Code for Admins: The Last Step to Apex
Adam Olshansky
 
PDF
Lightning Components 101: An Apex Developer's Guide
Adam Olshansky
 
PPTX
Stamford developer group Experience Cloud
Amol Dixit
 
PDF
Salesforce Stamford developer group - power of flows
Amol Dixit
 
PDF
Admin Best Practices: 3 Steps to Seamless Deployments
Salesforce Admins
 
PDF
Maximize Apex Performance with Platform Cache
Adam Olshansky
 
PPTX
Stamford developer group Omni channel
Amol Dixit
 
PPTX
Winter '15 Highlights for Salesforce Admins
Salesforce Admins
 
PPTX
July 2020 Chicago Nonprofit Group - Summer '20 Highlights
csupilowski
 
PDF
Stephen's 10 ish favourite spring'20 features
Auckland Salesforce User Group
 
PPTX
Fantastic Formulas-Salesforce NY World tour
Rich Spitz
 
PDF
Lightning Connect Custom Adapters: Connecting Anything with Salesforce
Salesforce Developers
 
Apply the Salesforce CLI To Everyday Problems
Peter Chittum
 
LMS Lightning Message Service
Peter Chittum
 
If you can write a Salesforce Formula you can use the command line
Peter Chittum
 
Shadow DOM, CSS and Styling Hooks in LWC what you need to know
Sudipta Deb ☁
 
Winter '22 highlights
AtaullahKhan31
 
Women in Tech - Salesforce Debug Logs Deep Dive with Jess Lopez - March 2021
Alesia Dvorkina
 
Lightning User Interface Testing with Selenium and Node JS
Keir Bowden
 
Dreamforce Global Gathering
Sudipta Deb ☁
 
Demystifying Code for Admins: The Last Step to Apex
Adam Olshansky
 
Lightning Components 101: An Apex Developer's Guide
Adam Olshansky
 
Stamford developer group Experience Cloud
Amol Dixit
 
Salesforce Stamford developer group - power of flows
Amol Dixit
 
Admin Best Practices: 3 Steps to Seamless Deployments
Salesforce Admins
 
Maximize Apex Performance with Platform Cache
Adam Olshansky
 
Stamford developer group Omni channel
Amol Dixit
 
Winter '15 Highlights for Salesforce Admins
Salesforce Admins
 
July 2020 Chicago Nonprofit Group - Summer '20 Highlights
csupilowski
 
Stephen's 10 ish favourite spring'20 features
Auckland Salesforce User Group
 
Fantastic Formulas-Salesforce NY World tour
Rich Spitz
 
Lightning Connect Custom Adapters: Connecting Anything with Salesforce
Salesforce Developers
 

Similar to Deep dive into salesforce connected app - part 2 (20)

PDF
Delivering powerful integrations without code using out-of-the-box Salesforce...
Cynoteck Technology Solutions Private Limited
 
PDF
Alba Rivas - Building Slack Applications with Bolt.js.pdf
MarkPawlikowski2
 
PDF
TDX Global Gathering - Wellington UG
Stephan Chandler-Garcia
 
PPTX
Introduction to Salesforce Pub-Sub APIs/Architecture
Amol Dixit
 
PDF
TrailheadX Presentation - 2020 Cluj
Arpad Komaromi
 
PPTX
London Salesforce Developers TDX 20 Global Gathering
Keir Bowden
 
PDF
Orchestrator and Flow in Slack: Antoine Cabot - Jacksonville Architects - Sal...
A. Engin Utkan
 
PPTX
Summer 23 LWC Updates + Slack Apps.pptx
Kishore B T
 
PPTX
Demystify Metadata Relationships with the Dependency API
Developer Force
 
PPTX
Save Millions of Clicks! Easily migrate complex schemas from SQL to Salesforce.
Daniel Peter
 
PDF
Local development with Open Source Base Components
Salesforce Developers
 
PPTX
Kitchener Developer Group's session on "All about events"
Sudipta Deb ☁
 
PDF
Dreamforce 2019 Five Reasons Why CLI Plugins are a Salesforce Partners Secret...
Vivek Chawla
 
PDF
Jaipur MuleSoft Meetup No. 3
Lalit Panwar
 
PDF
How to excel at your next Salesforce Hackathon (1).pdf
Sheeba Thukral
 
PPTX
Manage and Release Changes Easily and Collaboratively with DevOps Center - Sa...
Amol Dixit
 
PPTX
Eda gas andelectricity_meetup-adelaide_pov
Nicholas Bowman
 
PDF
WT19: Platform Events Are for Admins Too!
Salesforce Admins
 
PDF
Austin Developers - New Lighting Web Component Features & #TDX22 Updates
NadinaLisbon1
 
PDF
SalesforceBusiness Rules Engine - Intro & Demo.pdf
joaoabelbaptista
 
Delivering powerful integrations without code using out-of-the-box Salesforce...
Cynoteck Technology Solutions Private Limited
 
Alba Rivas - Building Slack Applications with Bolt.js.pdf
MarkPawlikowski2
 
TDX Global Gathering - Wellington UG
Stephan Chandler-Garcia
 
Introduction to Salesforce Pub-Sub APIs/Architecture
Amol Dixit
 
TrailheadX Presentation - 2020 Cluj
Arpad Komaromi
 
London Salesforce Developers TDX 20 Global Gathering
Keir Bowden
 
Orchestrator and Flow in Slack: Antoine Cabot - Jacksonville Architects - Sal...
A. Engin Utkan
 
Summer 23 LWC Updates + Slack Apps.pptx
Kishore B T
 
Demystify Metadata Relationships with the Dependency API
Developer Force
 
Save Millions of Clicks! Easily migrate complex schemas from SQL to Salesforce.
Daniel Peter
 
Local development with Open Source Base Components
Salesforce Developers
 
Kitchener Developer Group's session on "All about events"
Sudipta Deb ☁
 
Dreamforce 2019 Five Reasons Why CLI Plugins are a Salesforce Partners Secret...
Vivek Chawla
 
Jaipur MuleSoft Meetup No. 3
Lalit Panwar
 
How to excel at your next Salesforce Hackathon (1).pdf
Sheeba Thukral
 
Manage and Release Changes Easily and Collaboratively with DevOps Center - Sa...
Amol Dixit
 
Eda gas andelectricity_meetup-adelaide_pov
Nicholas Bowman
 
WT19: Platform Events Are for Admins Too!
Salesforce Admins
 
Austin Developers - New Lighting Web Component Features & #TDX22 Updates
NadinaLisbon1
 
SalesforceBusiness Rules Engine - Intro & Demo.pdf
joaoabelbaptista
 
Ad

More from Mohith Shrivastava (19)

PDF
Best Practices with Apex in 2022.pdf
Mohith Shrivastava
 
PPTX
Successfully creating unlocked package
Mohith Shrivastava
 
PPTX
Build your own dev tools with salesforce cli plugin generator
Mohith Shrivastava
 
PPTX
Modular application development using unlocked packages
Mohith Shrivastava
 
PPTX
Introduction to lightning Web Component
Mohith Shrivastava
 
PPTX
Building Apps On Lightning
Mohith Shrivastava
 
PPTX
Modular Salesforce Application Development Using DX
Mohith Shrivastava
 
PPTX
Spring18 Lightning Component Updates
Mohith Shrivastava
 
PPTX
Introduction To Service Cloud Snapins SDK
Mohith Shrivastava
 
PPTX
Introduction to einstein analytics sdk for lightning
Mohith Shrivastava
 
PPTX
Machine learning with salesforce data using prediction io
Mohith Shrivastava
 
PPTX
Debugging lightning components-SEDreamin17
Mohith Shrivastava
 
PPTX
Introduction to Analytics Cloud
Mohith Shrivastava
 
PPTX
Debugging lightning components
Mohith Shrivastava
 
PPTX
Introduction to lightning out df16
Mohith Shrivastava
 
PPTX
Introduction to lightning components
Mohith Shrivastava
 
PPTX
Lighnting component development
Mohith Shrivastava
 
PPTX
Lightning strikes twice- SEDreamin
Mohith Shrivastava
 
PPTX
Dallas meetup
Mohith Shrivastava
 
Best Practices with Apex in 2022.pdf
Mohith Shrivastava
 
Successfully creating unlocked package
Mohith Shrivastava
 
Build your own dev tools with salesforce cli plugin generator
Mohith Shrivastava
 
Modular application development using unlocked packages
Mohith Shrivastava
 
Introduction to lightning Web Component
Mohith Shrivastava
 
Building Apps On Lightning
Mohith Shrivastava
 
Modular Salesforce Application Development Using DX
Mohith Shrivastava
 
Spring18 Lightning Component Updates
Mohith Shrivastava
 
Introduction To Service Cloud Snapins SDK
Mohith Shrivastava
 
Introduction to einstein analytics sdk for lightning
Mohith Shrivastava
 
Machine learning with salesforce data using prediction io
Mohith Shrivastava
 
Debugging lightning components-SEDreamin17
Mohith Shrivastava
 
Introduction to Analytics Cloud
Mohith Shrivastava
 
Debugging lightning components
Mohith Shrivastava
 
Introduction to lightning out df16
Mohith Shrivastava
 
Introduction to lightning components
Mohith Shrivastava
 
Lighnting component development
Mohith Shrivastava
 
Lightning strikes twice- SEDreamin
Mohith Shrivastava
 
Dallas meetup
Mohith Shrivastava
 
Ad

Recently uploaded (20)

PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
Advancing WebDriver BiDi support in WebKit
Igalia
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PDF
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
New from BookNet Canada for 2025: BNC BiblioShare - Tech Forum 2025
BookNet Canada
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
Advancing WebDriver BiDi support in WebKit
Igalia
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
IoT-Powered Industrial Transformation – Smart Manufacturing to Connected Heal...
Rejig Digital
 

Deep dive into salesforce connected app - part 2

  • 1. Deep Dive into Salesforce Connected App - Part 2 @msrivastav13 | [email protected] Mohith Shrivastava, Lead Developer Evangelist
  • 2. Forward-Looking Statement Statement under the Private Securities Litigation Reform Act of 1995: This presentation contains forward-looking statements about the company’s financial and operating results, which may include expected GAAP and non-GAAP financial and other operating and non-operating results, including revenue, net income, diluted earnings per share, operating cash flow growth, operating margin improvement, expected revenue growth, expected current remaining performance obligation growth, expected tax rates, the one-time accounting non-cash charge that was incurred in connection with the Salesforce.org combination; stock- based compensation expenses, amortization of purchased intangibles, shares outstanding, market growth and sustainability goals. The achievement or success of the matters covered by such forward-looking statements involves risks, uncertainties and assumptions. If any such risks or uncertainties materialize or if any of the assumptions prove incorrect, the company’s results could differ materially from the results expressed or implied by the forward-looking statements we make. The risks and uncertainties referred to above include -- but are not limited to -- risks associated with the effect of general economic and market conditions; the impact of geopolitical events; the impact of foreign currency exchange rate and interest rate fluctuations on our results; our business strategy and our plan to build our business, including our strategy to be the leading provider of enterprise cloud computing applications and platforms; the pace of change and innovation in enterprise cloud computing services; the seasonal nature of our sales cycles; the competitive nature of the market in which we participate; our international expansion strategy; the demands on our personnel and infrastructure resulting from significant growth in our customer base and operations, including as a result of acquisitions; our service performance and security, including the resources and costs required to avoid unanticipated downtime and prevent, detect and remediate potential security breaches; the expenses associated with new data centers and third-party infrastructure providers; additional data center capacity; real estate and office facilities space; our operating results and cash flows; new services and product features, including any efforts to expand our services beyond the CRM market; our strategy of acquiring or making investments in complementary businesses, joint ventures, services, technologies and intellectual property rights; the performance and fair value of our investments in complementary businesses through our strategic investment portfolio; our ability to realize the benefits from strategic partnerships, joint ventures and investments; the impact of future gains or losses from our strategic investment portfolio, including gains or losses from overall market conditions that may affect the publicly traded companies within the company's strategic investment portfolio; our ability to execute our business plans; our ability to successfully integrate acquired businesses and technologies, including delays related to the integration of Tableau due to regulatory review by the United Kingdom Competition and Markets Authority; our ability to continue to grow unearned revenue and remaining performance obligation; our ability to protect our intellectual property rights; our ability to develop our brands; our reliance on third-party hardware, software and platform providers; our dependency on the development and maintenance of the infrastructure of the Internet; the effect of evolving domestic and foreign government regulations, including those related to the provision of services on the Internet, those related to accessing the Internet, and those addressing data privacy, cross-border data transfers and import and export controls; the valuation of our deferred tax assets and the release of related valuation allowances; the potential availability of additional tax assets in the future; the impact of new accounting pronouncements and tax laws; uncertainties affecting our ability to estimate our tax rate; the impact of expensing stock options and other equity awards; the sufficiency of our capital resources; factors related to our outstanding debt, revolving credit facility, term loan and loan associated with 50 Fremont; compliance with our debt covenants and lease obligations; current and potential litigation involving us; and the impact of climate change. Further information on these and other factors that could affect the company’s financial results is included in the reports on Forms 10-K, 10-Q and 8-K and in other filings it makes with the Securities and Exchange Commission from time to time. These documents are available on the SEC Filings section of the Investor Information section of the company’s website at www.salesforce.com/investor. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements, except as required by law.
  • 3. Recap ● What is a Connected App? ● Authentication vs Authorization ● Single Sign-On(SSO), SAML 2.0 ● Connected App Use Cases ● Demo - Created simple Connected app and covered web server oauth2 flow ● Connected App Developers vs Connected App Admins ● Key Considerations when deploying Connected Apps ● References
  • 4. ● Access Data with API Integration ● Integrate other Service Providers within your Salesforce org ● Manage Access to third party apps ● Provide Authorization For External API Gateways Connected App Use Cases
  • 6. Agenda ● What is JWT tokens? ● JWT Structure ● How JWT tokens work? ● OAuth 2.0 JWT Bearer Flow for Server-to-Server Integration ● Demo ● References
  • 7. JWT stands for JSON Web Tokens. JSON Web Token (JWT) is an open standard (RFC 7519) that defines a compact and self- contained way for securely transmitting information between parties as a JSON object. Information can be verified and trusted because it is digitally signed. JWTs can be signed using a secret (with the HMAC algorithm) or a public/private key pair using RSA or ECDSA. I What is JWT?
  • 8. It will look like below eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiYWRtaW4iOnRydWV9. TJVA95OrM7E2cBab30RMHrHDcEfxjoYZgeFONFh7HgQ <headerbase64encodedurl>. <claimsbase64encodedclaims>.<signature> What is JWT ? cont...
  • 9. ● Header ● Payload ● Signature JWT Structure
  • 11. The second part of the token is the payload, which contains the claims. Claims are statements about an entity (typically, the user) and additional data. There are three types of claims: registered, public, and private claims. { "sub": "1234567890", "name": "TrailheadLive App", "iat": 1516239022 } Payload
  • 12. HMACSHA256( base64UrlEncode(header) + "." + base64UrlEncode(payload), secret) Signature
  • 13. How Does JWT Work? Client Application Authorization Server(/v2/oauth2/token) Resource Server(Salesforce API) 2 1 3 1. The application requests authorization to the Salesforce authorization server. 2. Salesforce Authorization Server on successful authorization responds with an access token 3. Using access token the client application can access the Resource Server API
  • 14. ● Use this flow for Server to Server Integration. ● Note that you should pre approve the connected app once before you can use this flow. ● Salesforce requires that a JWT is signed using RSA SHA256, which uses an uploaded certificate as the signing secret. OAuth 2.0 JWT Bearer Flow for Server-to-Server Integration
  • 15. Steps to create Valid JWT {"alg":"RS256"} Encode the header using base64URLencode {"iss": <consumer key from connected app>, "sub": <username>, "aud": "https://login.salesforc e.com", "exp": <currenunixtime> } NOTE- This has to be compact one line in JSON Encode the claims using base64URLencode encoded_JWT_Header + "." + encoded_JWT_Claims_ Set Construct JWT Header base64URL encode Construct JSON claims Base64URLEncode Claims Encoded Header and Claims
  • 16. Steps to create Valid JWT contd.. Use openssl lib for this HMACSHA256( base64UrlEncode(heade r) + "." + base64UrlEncode(paylo ad), secret) <base6encoded url>. <base64encode dclaims>. <signature> grant_type= urn:ietf:params:oaut h:grant-type:jwt- bearer& assertion=<jwt> Create X509 Certificate Sign the encoded String Construct JWT token Request access token
  • 18. ● Each X.509 certificate includes a public key, digital signature, and information about both the identity associated with the certificate and its issuing certificate authority (CA) ● The public key is part of a key pair that also includes a private key. The private key is kept secure, and the public key is included in the certificate. Public/Private key Usage: ○ Allows the owner of the private key to digitally sign documents; these signatures can be verified by anyone with the corresponding public key. ○ Allows third parties to send messages encrypted with the public key that only the owner of the private key can decrypt. X.509 Certificate
  • 20. JWT via Apex ● Requires the certificate imported in JKS format. ● JWT, JWS and JWTBearerTokenExchange class under Auth Namespace simplifies performing JWT Bearer Token flow
  • 21. ● Use openSSL to convert private key and certificate first to PKCS12 ○ openssl pkcs12 -export -in server.crt -inkey serverkey.pem -out testkeystore.p12 ● Use keytool to convert from PKCS12 to JKS, Remember to change alias so one can import it into Salesforce ○ keytool -importkeystore -srckeystore testkeystore.p12 -srcstoretype pkcs12 - destkeystore cert.jks -deststoretype JKS ○ keytool -keystore <keystorefilepath>/cert.jks -changealias -alias 1 -destalias <NEW_ALIAS> ● Troubleshooting help articles if keystore import fails ■ https://help.salesforce.com/articleView?id=000338348 ■ https://help.salesforce.com/articleView?id=000338720 Create JKS From Private Key and Public Certificate
  • 22. Continuous Integration Using Salesforce DX https://trailhead.salesforce.com/content/learn/modules/sfdx_travis_ci Create a Private key and Self Signed Certificate Instructions https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_key_and_cert.htm Authorize Apps with OAuth - JWT flow https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.htm&type=5 Connected Apps Basics Trailhead Module https://trailhead.salesforce.com/en/content/learn/modules/connected-app-basics Creating a Connected App Unit https://trailhead.salesforce.com/en/content/learn/projects/build-a-connected-app-for-api-integration/create-a-connected- app Debug Using JWT.io https://jwt.io References