Lowtide-Auth
One of my many gripes these days is the generally clunky workflow of Salesforce development. I won't opine about the different tools and processes, I'll only say that I personally prefer to build external tooling that can authenticate with Salesforce and manage its data via REST API.
I wanted to boilerplate the authentication piece so that any further development of tools or demos could have a really easy starting point. I've provided three ways, "strategies" to authenticate, of course using username/password, an active session token, or via oauth2.
Once authenticated, your Salesforce authentication information is written to your express-session
session which is stored in Redis. You could implement a different store, I know express-session supports many different types.
The repo's readme gives more detail. There's a demo server up that you can make requests against, ie.visiting /api/auth/oauth and authenticating with a Salesforce org, then trying /api/auth/session to see what was stored:
{
"cookie":{
...
},
"salesforce":{
"api":{
"label":"Winter '21",
"url":"/services/data/v50.0",
"version":"50.0"
},
"auth":{
"accessToken":"...",
"instanceUrl":"..."
},
"user":{
"id":"...",
"name":"Luc Manager",
"email":"...",
"username":"..."
}
}
}
Notice the bonus where it stores the latest API version and URL for you. ♥️
Cheers.