Launch Week Day 2: Introducing Reports: An Extensible Reporting Framework for Socket Data.Learn More
Socket
Book a DemoSign in
Socket

passport-salesforce-auth

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

passport-salesforce-auth

Passport strategy for Salesforce that includes request object passthrough.

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

CircleCI

passport-salesforce-auth

Passport strategy for Salesforce that includes request object passthrough.

Installation

npm install passport-salesforce-auth

Usage

Aside from the standard required fields, this module allows to optionally have passport include the express request object into the verification function (through the first variable).

Parameters:

  • clientID - Salesforce consumer key
  • clientSecret - Salesforce consumer secret
  • callbackURL - oauth callback url

Optional Parameters:

  • passReqToCallback (default false) - directs passport to send the request object to the verfication callback

Examples

With request

const strategy = new SalesforceStrategy(
    {
        clientID: '<clientID>',
        clientSecret: '<clientSecret>',
        callbackURL: '<callbackURL>',
        passReqToCallback: true
    },
    async (request, accessToken, refreshToken, profile, done) => {
        
        done(null, <user.id>);
    }
);

Profile Response:

{
    provider: 'salesforce',
    sub: 'https://login.salesforce.com/id/<id>/<id>',
    user_id: '<id>',
    organization_id: '<org_id>',
    preferred_username: '<email>',
    nickname: 'john',
    name: 'John Barlow',
    email: '<email>',
    email_verified: true,
    given_name: 'John',
    family_name: 'Barlow',
    zoneinfo: 'America/Los_Angeles',
    photos: {
        picture: 'https://c.na172.content.force.com/profilephoto/005/F',
        thumbnail: 'https://c.na172.content.force.com/profilephoto/005/T'
    },
    profile: 'https://na172.salesforce.com/<id>',
    picture: 'https://c.na172.content.force.com/profilephoto/005/F',
    address: { country: 'US' },
    urls: {
        enterprise: 'https://na172.salesforce.com/services/Soap/c/{version}/<id>',
        metadata: 'https://na172.salesforce.com/services/Soap/m/{version}/<id>',
        partner: 'https://na172.salesforce.com/services/Soap/u/{version}/<id>',
        rest: 'https://na172.salesforce.com/services/data/v{version}/',
        sobjects: 'https://na172.salesforce.com/services/data/v{version}/sobjects/',
        search: 'https://na172.salesforce.com/services/data/v{version}/search/',
        query: 'https://na172.salesforce.com/services/data/v{version}/query/',
        recent: 'https://na172.salesforce.com/services/data/v{version}/recent/',
        tooling_soap: 'https://na172.salesforce.com/services/Soap/T/{version}/<id>',
        tooling_rest: 'https://na172.salesforce.com/services/data/v{version}/tooling/',
        profile: 'https://na172.salesforce.com/<id>',
        feeds: 'https://na172.salesforce.com/services/data/v{version}/chatter/feeds',
        groups: 'https://na172.salesforce.com/services/data/v{version}/chatter/groups',
        users: 'https://na172.salesforce.com/services/data/v{version}/chatter/users',
        feed_items: 'https://na172.salesforce.com/services/data/v{version}/chatter/feed-items',
        feed_elements: 'https://na172.salesforce.com/services/data/v{version}/chatter/feed-elements'
    },
    active: true,
    user_type: 'STANDARD',
    language: 'en_US',
    locale: 'en_US',
    utcOffset: -28800000,
    updated_at: '2020-05-29T21:39:24Z',
    is_app_installed: true
    }

Keywords

passport

FAQs

Package last updated on 09 Dec 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts