Question

"Session expired or invalid" when authenticating to Salesforce with OAuth2

  • 16 January 2021
  • 2 replies
  • 492 views

Userlevel 2
Badge

I’ve been trying for weeks to get the Authentication to work for a Zapier integration I’m building for a native Salesforce app.

Here’s the response I get when testing the Authentication:

The app returned "Session expired or invalid". What happened (You are seeing this because you are an admin): Stack trace: ResponseError: {"status":401,"headers":{"content-type":"application/json;charset=UTF-8"},"content":"[{\"message\":\"Session expired or invalid\",\"errorCode\":\"INVALID_SESSION_ID\"}]","request":{"url":"https://slapfiveportest-dev-ed.my.salesforce.com/services/apexrest/refedge/v1.0/ReferenceEdge/Content/?%7B%7Bbundle.inputData.instance_base_url%7D%7D=instance_base_url"}} at Object.throwForStatus (/var/task/node_modules/zapier-platform-core/src/http-middlewares/after/throw-for-status.js:7:11) From previous event: at executeHttpRequest (/var/task/node_modules/zapier-platform-core/src/execute.js:22:6) at execute (/var/task/node_modules/zapier-platform-core/src/execute.js:90:12) at input (/var/task/node_modules/zapier-platform-core/src/create-command-handler.js:29:14) at Object.beforeMiddleware.then.newInput (/var/task/node_modules/zapier-platform-core/src/middleware.js:90:22) at bound (domain.js:402:14) at Object.runBound (domain.js:415:12) From previous event: at input (/var/task/node_modules/zapier-platform-core/src/middleware.js:89:45) at loadApp.then.appRaw (/var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:215:18) at bound (domain.js:402:14) at runBound (domain.js:415:12) at runCallback (timers.js:705:18) at tryOnImmediate (timers.js:676:5) at processImmediate (timers.js:658:5) at process.topLevelDomainCallback (domain.js:126:23) From previous event: at Domain.handlerDomain.run (/var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:200:10) at Domain.run (domain.js:349:14) at Runtime.handler (/var/task/node_modules/zapier-platform-core/src/tools/create-lambda-handler.js:192:19) at Runtime.handleOnce (/var/runtime/Runtime.js:66:25)

 

Can anyone point me in the right direction to get beyond this?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

Userlevel 7
Badge +12

Hi @jeffernst - Can you tell me what OAuth2 scopes is your app configured with in Salesforce? Thanks!

Userlevel 2
Badge

@ikbelkirasan The scopes that the native Salesforce app needs are api and refresh_token.

Jeff