function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amar PrasadAmar Prasad 

Openid connect Issue with Node

Hi Team,

I am trying to connect the salesforce using OpenID connect with NODE JS. I added a configuration in "Auth. Provider" section. Here is the Screenshot. User-added image

I configured all the properties in my application. I am using "Passport JS Node OpenID Client" to authenticate with Salesforce. Here is the github URL: https://github.com/panva/node-openid-client. But when I tried to connect I am getting error
 
OpenIdConnectError: invalid_client_id (client identifier invalid)
    at Client.requestErrorHandler (/Users/arthurfiddich/githome/AT/node_passport_js/node_modules/openid-client/lib/helpers/error_handler.js:16:11)
    at process._tickCallback (internal/process/next_tick.js:68:7)
I am able to connect with GOOGLE but not with the SALESFORCE. Can anyone please tell me what I have missed.? I am pasting my code below.
 
const { Issuer, Strategy } = require("openid-client");
const express = require("express");
const router = express.Router();
const passport = require("passport");
const winston = require("winston");
const { SSOUser: User } = require("../models/ssoUser");
Issuer.defaultHttpOptions = { timeout: 10000 };
const salesforceIssuer = new Issuer({
  issuer: "https://login.salesforce.com",
  authorization_endpoint:
    "https://login.salesforce.com/services/oauth2/authorize",
  token_endpoint: "https://login.salesforce.com/services/oauth2/token",
  userinfo_endpoint: "https://login.salesforce.com/services/oauth2/userinfo",
  jwks_uri: "https://login.salesforce.com/services/oauth2/certs"
  //   jwks_uri: "https://login.salesforce.com/id/keys"
}); // => Issuer
console.log(
  "Set up issuer %s %O",
  salesforceIssuer.issuer,
  salesforceIssuer.metadata
);

const salesforceClient = new salesforceIssuer.Client({
  client_id:
    "3MVG9YDQS5WtC11qVSGVNJu2iTDIYmCMgLcKZazZVL0mBN_vcBZYUj.lVgNyOqVpGgt3YwFx.pYAYGPxqUB.1",
  client_secret: "282444478201962758",
  redirect_uris: ["http://localhost:3000/openId/salesforce/redirect"]
}); // => Client

const salesforceParams = {
  client_id: salesforceClient.client_id,
  redirect_uri: salesforceClient.redirect_uris[0],
  // scope: "api",
  response_type: "code"
  // ... any authorization request parameters go here
  // client_id defaults to client.client_id
  // redirect_uri defaults to client.redirect_uris[0]
  // response type defaults to client.response_types[0], then 'code'
  // scope defaults to 'openid'
};
const passReqToCallback = false; // optional, defaults to false, when true req is passed as a first
// argument to verify fn

const usePKCE = true; // optional, defaults to false, when true the code_challenge_method will be
// resolved from the issuer configuration, instead of true you may provide
// any of the supported values directly, i.e. "S256" (recommended) or "plain"

passport.use(
  "oidc",
  new Strategy(
    { client: salesforceClient, params: salesforceParams, usePKCE: false },
    (tokenset, userinfo, done) => {
      console.log("tokenset", tokenset);
      console.log("access_token", tokenset.access_token);
      console.log("id_token", tokenset.id_token);
      console.log("claims", tokenset.claims);
      console.log("userinfo", userinfo);
    }
  )
);
// start authentication request
// options [optional], extra authentication parameters
router.get("/salesforce", passport.authenticate("oidc"));

// authentication callback
router.get(
  "/salesforce/redirect",
  passport.authenticate("oidc"),
  (req, res) => {
    console.log(req);
    console.log("------------------------------------------------");
    console.log(res);
  }
);

passport.serializeUser((user, done) => {
  done(null, user.sub);
});

passport.deserializeUser((id, done) => {
  User.findById(id).then(user => {
    done(null, user);
  });
});

module.exports = router;

Can anyone please help me to solve this issue and this is the blocker for me.? Also, if anyone has a good article to connect with salesforce please point me to that.

Thanks & Regards,
Amaralingeswararao.T
Jason Miller 92Jason Miller 92
Make sure to check your router's settings first. Howeven if you need help with routerlogin (https://routerloginnet.live/), you can contact us.
Ronald Lee 4Ronald Lee 4
Thanks for sharing this informative thread. I am so glad to share that people who are facing problem with orbi setup (https://orbi-setup.net/), orbilogin and installation,they can contact us.
Aaron PakerAaron Paker
Firstly, check your internet connection. If you found any difficulty in your WiFi device then you can contact us for assistance. Mywi-fiext (https://mywi-fiext.net/)
Aaron PakerAaron Paker
Check the internet connection. If you still face any issue while connecting your WiFi device then you can contact our professionals. https://routerlognnet.us/
charls dancharls dan
I am glad that I came across this post. 

orbilogin net (https://orbilogin-net.net)
 
Alice GartenAlice Garten
Don't be panic. Firstly, check your WiFi or other internet connection. If you found any issue during WiFi connectivity then contact our professionals. Visit here: Mywifiextlog.net (https://mywifiextlog.net/)
edward kortizedward kortiz
Thanks for the sharing.
edward kortizedward kortiz
https://nighthawklogin.net/
John Watson 24John Watson 24
Thanks for sharing such useful information. I have a solution to resolve a very critical problem of orbi login (https://www.orbilogiin.com/)
Jahon AdrsonJahon Adrson
Though i have learned about it but after read your thread, i just realized the amount of knowledge that i missed. Thank for your shared.
if you want to get technical support regarding amped wireless setup visit to our website
John HorryJohn Horry
If you are unable to load the dlink login page using the http://dlinkap.local , then you are at the right place. Here, you will know all the reasons behind the issue of dlinkap.local not working and how you can resolve it without much trouble. For more details contact us.
Veronica HinesVeronica Hines
linksys setuplinksys setup

Are you looking for the answer to know how to setup a wifi extender (https://extenderslinksys.com/how-to-setup-a-linksys-wifi-extender/)? You can do it easily with some simple steps only. Here, we will provide you all the solutions for your issue. You can check if there is no issue with the wired connection. For more detailed information get in touch with us.

Read more Click here

Orbi loginOrbi login
Are you wondering orbi login router? You do not have to worry about that anymore. You can now easily do that once you are logged into your router. For more detailed information,<a href="https://orblogin.site/" rel="nofollow">orbi login</a> give us a call on our toll-free number and get the proper assistance.
Read more (https://orblogin.site/)
Dlink RouterDlink Router
How to do the d link router local login easily?
If you're experiencing difficulties with your d link router local (https://dllnkroutlocl.net/)and web address isn't functioning, you don't have to worry. You can solve this problem by following the troubleshooting procedures outlined here. All you have to do is follow the step-by-step instructions, and you'll be fine.
Tplink RouterTplink Router


It has become easy to access the http extender linksys com page with some simple steps only. For that, you have to connect your devices using the default web address and then go to the login page. Now, enter the default login credentials and reach the setup page.
 
HP Printer SetupHP Printer Setup
HP printer setup (https://printwireless247.com/" style="color:blue; text-decoration:underline) and installation is quick and simple. Here, you will get tips on how to connect HP printer to wifi (https://printwireless247.com/" style="color:blue; text-decoration:underline). If you face any issues while connecting your printer to the network, get simple troubleshooting tips from the technical experts. 
our printer to the network, get simple troubleshooting tips from the technical experts. 
 
David DpDavid Dp
The dlinkap.local setup process can be used to set up your D-Link range extender easily. You will need the username and the password details to access the login page and the main router SSID and password to sync your extender to the router as well. For more information on the D-Link extender setup process, you can always reach out to the team at our end.
Ron Martin 9Ron Martin 9

http://tplinkwifi.net (https://tplinkswifi.net/)is the default web address for your Tp Link WiFi router. Connect your router to the computer and type this address in the web browser. After that, put down the username and password of our router admin console. Lastly, click the Login button and you will be logged into the Tp Link WiFi router. 


Tplink Firmware Update (https://tplinkswifi.net/tplink-firmware-update/)
Ron Martin 9Ron Martin 9

For simplisafe.com login (https://simplsmart.com/), connect your PC to a WiFi network and open a web browser on it. Enter the default web address simplisafe.com and you will reach the SimpliSafe login (https://simplsmart.com/) page. Enter the SimpliSafe My account login credentials. After that, click Login and you will be successfully logged into the SimpliSafe account.