Switch to Bearer in Authorization header instead of OAuth in REST client

Created on 8 August 2025, about 2 months ago

Problem/Motivation

For some reason the REST client uses a hardcoded OAuth authorization type instead of Bearer (link ). This results connection errors like below (also see the the attached screenshot).

Error when connecting to Salesforce. Please check your credentials and try again: Client error: `GET [HOST]/services/data/v52.0/sobjects` resulted in a `401 Unauthorized` response: [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}] [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}]

After some investigation and research it's still not entirely clear to me why OAuth is used instead of Bearer because:

1. Bearer is the standard value.
2. Even the official documentation says it should be Bearer: OAuth 2.0 JWT Bearer Flow for Server-to-Server Integration.

My assumption is that OAuth is a legacy type and it is kept for backwards compatibility for older APIs but it's not clear to me exactly where and in what situations.

Steps to reproduce

I'm not sure how this could be reproduced consistently because a couple of months ago I managed to connect to the Salesforce organization without any issues, but now I'm having a problem with another one. I can also imagine that this can be related to some organization specific authorization settings, but that's very unlikely.

Proposed resolution

Fix the REST client to use Bearer instead of OAuth in the Authorization header.

Remaining tasks

User interface changes

N/A

API changes

N/A

Data model changes

N/A

πŸ› Bug report
Status

Active

Version

5.1

Component

salesforce.module

Created by

πŸ‡­πŸ‡ΊHungary balazswmann

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024