All Projects → adityanaag3 → lwc-oss-oauth

adityanaag3 / lwc-oss-oauth

Licence: CC0-1.0 license
Sample Code for connecting to Salesforce using OAuth Web Server flow from an LWC OSS App

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to lwc-oss-oauth

lwc-soql-builder
Awesome SOQL execution tool developed in Lightning Web Components Open Source
Stars: ✭ 85 (+372.22%)
Mutual labels:  salesforce, lwc-oss
quiz-host-app
Multiplayer quiz app built on Salesforce technology (host app)
Stars: ✭ 69 (+283.33%)
Mutual labels:  salesforce, lwc-oss
awesome-lwc
A list of interesting on platform Lightning Web Components resources and code examples
Stars: ✭ 124 (+588.89%)
Mutual labels:  salesforce, lwc-oss
apex-rollup
Fast, configurable, elastically scaling custom rollup solution. Apex Invocable action, one-liner Apex trigger/CMDT-driven logic, and scheduled Apex-ready.
Stars: ✭ 133 (+638.89%)
Mutual labels:  salesforce
lightning-chatter-messenger
⚡ Lightweight Chatter messenger utility item, which supports real-time private conversation, in Salesforce Lightning Experience. Built by Lightning Web Component.
Stars: ✭ 33 (+83.33%)
Mutual labels:  salesforce
dreaminvest-lwc
Sample application for Lightning Web Components on Salesforce Platform. Part of the sample gallery. Financial services use case. Get inspired and learn best practices.
Stars: ✭ 41 (+127.78%)
Mutual labels:  salesforce
R.apex
Functional utility library for Apex
Stars: ✭ 80 (+344.44%)
Mutual labels:  salesforce
wire-service-jest-util
Utility library for @-wire Lightning Web Component tests
Stars: ✭ 18 (+0%)
Mutual labels:  salesforce
sa11y
Salesforce Automated Accessibility Testing Libraries
Stars: ✭ 58 (+222.22%)
Mutual labels:  salesforce
sfdc-error-playground
Lightning & Apex Error Playground
Stars: ✭ 30 (+66.67%)
Mutual labels:  salesforce
Salesforce-Custom-Path-Assistant-LWC
A Salesforce custom path assistant built using only Lightning Web Components
Stars: ✭ 37 (+105.56%)
Mutual labels:  salesforce
sfdx-lwc-jest
Run Jest against LWC components in SFDX workspace environment
Stars: ✭ 136 (+655.56%)
Mutual labels:  salesforce
timeline-component-lwc
This component enables timeline view for Salesforce Record history.
Stars: ✭ 18 (+0%)
Mutual labels:  salesforce
vscode-apex-autocomplete
Add Language Services for Salesforce Apex
Stars: ✭ 19 (+5.56%)
Mutual labels:  salesforce
ApexCallouts
A lightweight Apex library for making HTTP callouts. Works with remote site settings and named credentials.
Stars: ✭ 32 (+77.78%)
Mutual labels:  salesforce
codeclimate-apexmetrics
ApexMetrics - Code Climate engine for Salesforce [DISCONTINUED use CC PMD instead)
Stars: ✭ 46 (+155.56%)
Mutual labels:  salesforce
texei-sfdx-plugin
Texeï's plugin for sfdx
Stars: ✭ 99 (+450%)
Mutual labels:  salesforce
apex-rest-route
A simple framework for building Restful API on Salesforce
Stars: ✭ 75 (+316.67%)
Mutual labels:  salesforce
sfmc-devtools
Fast-track your developers and devops engineers by allowing them to programmatically copy-paste / deploy changes and work offline
Stars: ✭ 94 (+422.22%)
Mutual labels:  salesforce
DXMate
Sublime Text 3 plugin to provide integration with the Salesforce DX CLI
Stars: ✭ 14 (-22.22%)
Mutual labels:  salesforce

Salesforce Integration with LWC OSS using OAuth Web Server Flow

This repo has the sample code for connecting to Salesforce using OAuth Web Server flow from an LWC OSS App.

About the app

The basic version of the app is built using the Trailhead Project Build Your First Application with Lightning Web Components Open Source.

The Salesforce Data Model for the app is created using the first 3 units of the Trailhead Project Access Salesforce Data with Lightning Web Components Open Source.

Logout Variations

The logout functionality is implemented in 2 different ways

  1. Logging out of the app, doesnt log you out of your active Salesforce session. The code for this is present in the master branch
  2. Logging out of the app also logs you out of your active Salesforce session. The code for this is present in the single-logout branch.

Using the app

  1. Create a connected app in your Salesforce Org

    1. Add http://localhost:3001/oauth2/callback to the list of Callback URLs.
    2. Add api to the list of Selected OAuth Scopes
  2. Note the Consumer Key and Consumer Secret.

  3. Clone this repository:

    git clone https://github.com/adityanaag3/lwc-oss-oauth
    cd lwc-oss-oauth
    
  4. Create a .env file at the root of the project, and add the following code:

    SALESFORCE_LOGIN_DOMAIN='https://login.salesforce.com'
    SALESFORCE_CLIENT_ID='YOUR_SALESFORCE_CONSUMER_KEY'
    SALESFORCE_CLIENT_SECRET='YOUR_SALESFORCE_CONSUMER_SECRET'
    SALESFORCE_CALLBACK_URL='http://localhost:3001/oauth2/callback'
    NODE_SESSION_SECRET_KEY='SOME_RANDOM_SECRET_KEY'
    
  5. Run npm install. (Refer to package.json for the dependencies that'll be installed)

  6. Run npm run watch. This will start the project with a local development server.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].