Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs
19 votes

Salesforce JWT User Hasn't Approved This Consumer (Again)

From the Salesforce OAuth JWT Flow documentation (hidden): A JWT OAuth 2.0 bearer assertion request looks at all the previous approvals for the user that include a refresh_token. If matching ...
csi's user avatar
  • 581
11 votes

Salesforce JWT User Hasn't Approved This Consumer (Again)

For either the sub or prn value, make sure you are using a username that exists in that org. For the aud make sure you are using test.salesforce.com for a sandbox environment and login.salesforce.com ...
flor's user avatar
  • 405
8 votes
Accepted

Connected App built in SANDBOX has access to PROD

This is a feature of OAuth, and is working as designed. A connected app clientId and secret can be used to connect to any org provided you go through oauth flow and enter username and password (or ...
Mohith Shrivastava's user avatar
7 votes
Accepted

How do I authorize access to a managed application in another org?

I just went through something similar where the final destination varied depending on the customer so a static callback int he code did not work. What I did on our LMA org to handle this was: Placed ...
Eric's user avatar
  • 54.2k
6 votes
Accepted

Rest call with same salesforce org - [Status=Unauthorized, StatusCode=401]

You don't need the Visualforce page. UserInfo.getSessionID() still works, you just cannot System.debug() a session ID - the logs will show SESSION_ID_REMOVED. Your 401 error usually indicates that ...
David Reed's user avatar
  • 93.1k
5 votes
Accepted

How Can I Access Site.com Studio for a Community Builder Site After Winter '17?

Navigate to Communities | Builder Now observe the URL .Remove of all the extra parameters after domain.The URL would look like below https://googleflowauth-dev-ed--sitestudio.ap1.force.com/ This ...
Mohith Shrivastava's user avatar
4 votes
Accepted

Need to call salesforce API from external system

Expanding on my comment: The JWT Oauth flow may be what you want, if you're operating a headless back-end application with no user interface. With the JWT flow, you'll create a Connected App in ...
David Reed's user avatar
  • 93.1k
4 votes

Salesforce JWT User Hasn't Approved This Consumer (Again)

My issue was I was using https://test.salesforce.com/ for the Authentication. Since our org has mydomain enabled so I have give my org url https://****--trng.sandbox.my.salesforce.com/ in the below ...
Thomas Raj's user avatar
4 votes

Salesforce JWT User Hasn't Approved This Consumer (Again)

"user hasn't approved this consumer" This is a common error caused when the user doesn't have a prior refresh_token associated with him/her. The solution is to perform an Autorization grant (Web ...
human's user avatar
  • 655
4 votes

Access Restricted for API Only Users

Salesforce owned many similar access control method , included "Profile" , "Permission set" , "Permission set Group" , "Public Group" ... To escape from "...
HO LI Pin's user avatar
  • 141
4 votes

SFDX: Authorize an Org hangs after login attempt

Most of us have this issue with Authorization command. Something may be broken in cli. One workaround is with this command: // authorize production org sfdx auth:device:login // authorize sandbox ...
Raul's user avatar
  • 18.8k
3 votes
Accepted

Error invalid_grant - expired authorization code while running sfdx force:auth:jwt:grant

In the end the problem was in the server time being way off. So if you have this problem, check your CI/CD server time. If it's off, please sync the time using NTP sync: sudo service ntp restart
Theodoor's user avatar
  • 461
3 votes

Named Credentials - Merge Fields not Resolving

I was running into a similar issue. If you are doing a GET call make sure you don't append a body or your request will NOT work with even with the correct headers. If you are doing a POST the ...
NickZeus's user avatar
  • 187
3 votes
Accepted

Why Am I getting invalid_client_credentials with Web Server OAuth Flow?

Found the problem! I had a typo in my token request. It should have been "client_secret" instead of "secret". so it should be: request.AddParameter("application/x-www-form-urlencoded", ...
Donuts's user avatar
  • 253
3 votes
Accepted

The authorization page for Marketing Cloud

The URI is: https://auth.exacttargetapis.com/v1/requestToken Straight from the docs the whole POST must be as follows :) POST https://auth.exacttargetapis.com/v1/requestToken Content-Type: ...
Javier García's user avatar
3 votes

Why is the "SFDX: Deploy Source to Org" function missing?

This could happen, if the default org is not set properly or more likely, the extension not activated yet. Ensure that the connector logo appears at the bottom toolbar of VSCode and right-click again ...
Kishan B's user avatar
  • 136
3 votes

Why is the "SFDX: Deploy Source to Org" function missing?

As of today (12.09.2021) my observation is that Deploy option in context menu depends to what kind of org you are connected/authorized to (which one is set as a default one). If it is a sandbox -> ...
user1974566's user avatar
  • 2,315
3 votes

Error while Authorizing an ORG using VS Code Cannot read properties of undefined (reading 'setContentsFromObject')

Try going to the .sfdx folder under Users/[name]/.sfdx and delete everything in there. I had the same problem and this fixed it.
Tyler's user avatar
  • 31
3 votes
Accepted

Salesforce oauth web server flow authorization - security issue

The Client ID isn't a secret, and this is by design. OAuth login requires additional data to be present, including a redirect_uri that matches the configuration of the Connected App, and for web ...
sfdcfox's user avatar
  • 494k
3 votes

Authorize an org failed in VS code

This is a problem in the installer in windows operating system. I recommend you first uninstall the Salesforce CLI installed on your machine using windows installer. The instructions to uninstall are ...
Mohith Shrivastava's user avatar
2 votes
Accepted

Can't get refresh_token in callback with a 'full' scope

Specify both scopes: scope: "refresh_token full", The scope parameter is a space-delimited list of scopes you would like to request. You can specify as many scopes as you need to be as granular as ...
sfdcfox's user avatar
  • 494k
2 votes
Accepted

Google OAuth and Authorization Code

Your understanding is correct. We take the authorization code from the page URL and use it to exchange for the authorization token and refresh token This exchange of the code for tokens is "...
Mark Pond's user avatar
  • 23k
2 votes

OAuth 2.0 JWT Bearer Token Flow - "user hasn't approved this consumer"

"user hasn't approved this consumer" This is a common error caused when the user doesn't have a prior refresh_token associated with him/her. The solution is to perform an Autorization grant (...
human's user avatar
  • 655
2 votes
Accepted

Rest API call to Salesforce from site - one call only

There's going to be at least two calls involved unless you use webhook-style authentication on a Apex REST API endpoint exposed to the public through a Force.com Site. With that style of ...
David Reed's user avatar
  • 93.1k
2 votes

Strip Authorisation header from inbound REST Request

You definitely can't control it from Salesforce's end; Salesforce checks authentication very early in the stack process, before any code you could possibly write could run. Your ideal situation would ...
sfdcfox's user avatar
  • 494k
2 votes

SFDX: Authorize an Org hangs after login attempt

I had the same error since a few days. Simply doing a "sfdx update" in the command line solved the problem for me... Currently I'm on sfdx-cli version 7.88.4 (sfdx --version)
Chris.Walz's user avatar
2 votes

Log in to salesforce from a react app

Use the OAuth 2.0 Web Server Flow for Web App Integration. You start by redirecting the user to: https://login.salesforce.com/services/oauth2/authorize?client_id=...
sfdcfox's user avatar
  • 494k
2 votes

can we authorize vscode using session id? because i am not able to authorize , it gives error that no event found

A command was recently added to the Salesforce Extension pack to authorize an org using a session ID. Look for 'SFDX: Authorize an Org using Session ID' from the command palette.
smaddox-sf's user avatar
2 votes
Accepted

Named credential JWT is not appearing in Authorization header in callout

You don't get a "JWT" header, because JWT typically (and in the case of Salesforce) uses the "Authorization" header with the Bearer scheme. The Authorization header contains all ...
Felix van Hove's user avatar
2 votes

Authorize Application Like Workbench

What you got to understand is that the Connected App record itself is an identifier for the application that is going to be using the Salesforce credentials. So you saying that "Gearset does the ...
Renato Oliveira's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible