Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [jwt]

The tag has no usage guidance.

0
votes
1answer
10 views

Generate JWToken from salesforce using Consumer Secret

I am trying to connect to an API and based on their requirement, JWToken is required to make a call and the JWToken must be signed using the provided consumer secret. Now, they have a sample code in ...
3
votes
1answer
69 views

This org appears to have a problem with its OAuth configuration. Reason: invalid_grant - audience is invalid

Error while trying to authorize an org through JWT from SFDX CLI on Windows. sfdx force:auth:jwt:grant --clientid <myclientid> --jwtkeyfile server.key --instanceurl https://mysandbox.my....
0
votes
1answer
22 views

Salesforce JWT Token for automation/background process

This is about JTW token for which my understanding is it last for long and can be used in automation/background process. For one of the project I generated the JWT token (https://help.salesforce.com/...
2
votes
1answer
29 views

How do I install and preauthorize app so I can use the JWT Bearer token flow?

I'm trying to follow the instructions in https://help.salesforce.com/articleView?id=remoteaccess_oauth_jwt_flow.htm&type=5 and get an invalid request with an error description of "refresh_token ...
1
vote
1answer
26 views

JWT authentication without a username?

I'm working on a managed package that needs to allow an external web service to call an Apex REST endpoint within the package. As far as I'm able to gather, the best route is to use OAuth2 JWT ...
1
vote
1answer
29 views

Add a custom header property in JWT assertion for OAuth

How do I add additional header properties to my JWT using the JWTBearerTokenExchange Class? (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/...
3
votes
0answers
76 views

Authorize into developer Sandbox using JWT

I am attempting to authorize a developer Sandbox using JWT in an attempt to implement a CI process. I found this related question on the subject: Can I connect to a sandbox using JWT Flow and Prod ...
0
votes
0answers
21 views

Not Listing Scratch Orgs in SDFX CLI

When I create a scratch org I get an error but the org gets created anyway. The error I receive is "ENOENT: no such file or directory" which I don't think is related to DX. There is no way for me to ...
1
vote
0answers
34 views

id_token not returned in JWT Bearer Token OAuth Flow

As per the JWT Bearer token documentation The id_token will be return if there is a pre-existing approval for the openid. I have existing approvals for openid for the user. Am I missing something in ...
0
votes
1answer
39 views

Journey Builder customAcvitity JWT decoded, no organization id

When the custom Activity execute / publish endpoints are called, and the JWT is decoded, there isn't any contextual information for which organization sent the call. This app could be used by many ...
0
votes
1answer
56 views

Salesforce DX connected app

I am trying to build a connected app- connected to our prod environment so that our developers could spin up scratch orgs and work there, however I dont want them to be able to use org:login and ...
1
vote
0answers
48 views

OpenID Single Sign On - Change Authentication Flow

I have an Auth Provider created with OpenID and everything is working good. But, I would like to change the Authentication Flow from web server to user-agent Source: https://help.salesforce.com/...
1
vote
0answers
71 views

[Talend SF Connection JWT]runtime exception https status 400-bad request message {“error”:“invalid_grant”,“error_description”:“audience is invalid”}

I am facing an error while trying to establish the Oauth connection (JWT) between talend ETL tool and salesforce : runtime exception https status 400-bad request message {"error":"invalid_grant","...
0
votes
1answer
80 views

JWT, Cyrpto.Sign and EncodingUtil.base64Encode

I'm writing my own class to create a JWT. Using the JSONGenerator I am creating the header and payload, base64 encoding these with EncodingUtils. I am then creating a blob from these to sign and use ...
1
vote
0answers
100 views

Salesforce OAuth 2.0 JWT Bearer Token Flow id_token

According to this guide id_token should be in the response if scope parameter contains openid, however the same guide says that scope parameter is not supported. As I've verified no id_token issued ...
2
votes
1answer
452 views

SalesforceDX: Log in to sandbox by username/password from command line without browser involved

Is it possible to log in from sfdx CLI to already existent sandbox having username/password combination? Reading through documentation I see bunch of ways how to authorize - through browser, by ...
2
votes
1answer
349 views

sfdx force:auth:jwt:grant ignoring the instanceurl param

I'm having troubles authenticating to my Dev Hub Org using the JWT token. The command: sfdx force:auth:jwt:grant --clientid *** --username *** --jwtkeyfile *** --setdefaultdevhubusername --...
5
votes
1answer
241 views

Unusual OAuth JWT Bearer Token Flow (Outbound) Integration Pattern

I have a client who's asking me to configure an OAuth JWT Bearer Token integration for them to retrieve delivery status information from a supplier. Salesforce is not the idP. Instead, the flow is ...
1
vote
1answer
255 views

Show user profile image - third party site

I am using Salesforce REST API to pull in the user profile salesforce object into my external site. I wanted to be able to display things like about me, title, and image on my site. I get all of this ...
0
votes
0answers
162 views

How can i write unit test for JWTBearerTokenExchange class

I have create a connected app and authorized in another org and get accessToken for login after that added the username and instance url of another org in custom object and with help of username and ...
0
votes
0answers
17 views

Normal to have two connected app in package

We want to do sso onto external system using a connected app. Also we want to do sync of data from external to SF's custom object created via managed app In this scenario we will need two connected ...
2
votes
1answer
192 views

OAuth 2.0 JWT Bearer Token Flow refresh_token

According to this SF StackExchange answer, the OAuth 2.0 JWT Bearer Token flow only need a one-time authorisation of the app certificate, and then you can forever issue a OAuth 2.0 JWT Bearer Token ...
0
votes
1answer
37 views

Salesforce to Salesforce authentication using JWT

I created a self signed certificate in my dev org A and exported the certificate to keystore. Now I want to use that certificate and import it in Org B to enable JWT authentication. But I get the ...
0
votes
0answers
104 views

Getting response invalid_grant user hasn't approved this consumer when using JWT Bearer Token [duplicate]

I have a Node.js program that attempting to get a token as shown below: 'use strict'; var request = require('request'); var jwt = require('jsonwebtoken'); var key = require('fs').readFileSync('./...
1
vote
1answer
793 views

How to determine the correct 'audience' and 'uri' when using OAuth 2.0 JSON Web Token (JWT) Bearer Token Flow

I have correctly been able to use "OAuth 2.0 Web Server Authentication Flow" and now I'd like to switch to "OAuth 2.0 JWT Bearer Token Flow". I wrote a test application in Node.js with the values two ...
0
votes
1answer
148 views

Salesforce canvas App using OAuth JWT 2.0 Bearer flow

We are trying to build a POC on integrating Salesforce with a third party portal using canvas app. We have to embed this portal into Salesforce when a user logs into Salesforce. We have a local portal ...
1
vote
1answer
174 views

JWT oauth flow “session expired” error

I'm working with a website developer to do some integration with a Salesforce REST API that I've written. We're using JWT oauth flow for the website to authenticate with the Salesforce sandbox. The ...
4
votes
2answers
390 views

Can I connect to a sandbox using JWT Flow and Prod connect app?

I'm trying to connect to a sandbox using the sfdx cli and the JWT flow through force:auth:jwt:grant. According to this Salesforce DX doc, we can use the same connected app information from Production ...
0
votes
0answers
76 views

Salesforce Oauth 2.0 JWT

I am getting below - {"error":"invalid_grant","error_description":"user hasn't approved this consumer"} Dev org To Dev Org, below are the connected app -
4
votes
0answers
695 views

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

I am trying to get JWT Bearer Token Flow to work. But get the error user hasn't approved this consumer. I have read these posts: Salesforce JWT User Hasn't Approved This Consumer (Again) OAuth 2....
2
votes
2answers
644 views

JWT bearer token flow in web app

I am building a web app, which should allow my app users to fetch their Salesforce data for analysis. For this, I am using OAUTH2.0 web server flow. TO avoid refresh_token related complexities, I am ...
0
votes
1answer
149 views

Connected App: Use external ClientId in JWT

As per this link, The issuer (iss) must be the OAuth client_id **or** the connected app for which the developer registered their certificate. Does this mean can I use external application client id ...
5
votes
1answer
3k views

Authentication using JWT

I am new to use JWT for authenticating external requests. I went through this help article. I am trying to implement above for the following usecase: External application (client) wants to access ...
0
votes
1answer
146 views

DX Scratch Org: Session expired or invalid on using JWT and jsforce

I have been testing FX and scratch orgs with jsforce and I based my first tests with this example. https://jsforce.github.io/blog/posts/20170629-salesforce-dx-with-jsforce.html With the recommendation ...
0
votes
1answer
181 views

frustrated trying to complete trail and getting this error message: Error: Compile Error: Variable does not exist: JWTBearerFlow at line 20 column 31

public class VisionController { // You can upload the `einstein_platform.pem` into your Salesforce org as `File` sObject and read it as below public String getAccessToken() { // Ignore ...
2
votes
1answer
214 views

Identify Marketing cloud account (user) details - Journey builder custom activity

I am working on custom activity where I need to identify the account (user) details from which the request came to the custom activity REST APIs. I thought setting "useJwt": true in the config.json ...
4
votes
2answers
4k views

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

I know others have asked this question.  The previous solutions have not worked.  Using the OAuth JWT flow.  All Users Can Authorize is selected  User authorized via https://login.salesforce.com/...
1
vote
0answers
159 views

CAN we use JWT with CA signed cert

We have an inbound integration to salesforce where client uses JWT login mechanism. A self signed cert has been provided from salesforce which they use to sign the request. Is there any way we can use ...
1
vote
1answer
672 views

JWT verify signature

I've got a jwt base64 encoded payload and a public certificate. I am able to decode the payload in apex but having hard time validating the signature. Its header has the algorithm RS256. How do I do ...
1
vote
1answer
418 views

Is Digital Signature mandatory for the oauth JWT token flow?

Is Digital Signature mandatory for the oauth JWT token flow ? If not, how do I implement the flow without the certificate.A web server is supposed to send a request for the access token and I need to ...
5
votes
0answers
359 views

How do you use a mock response when calling Auth.JWTBearerTokenExchange.getAccessToken()?

Let's say I have a class like this /** * Example of using JWTBearerTokenExchange to demonstrate issues with testing and mocks */ public class JwtBearerTokenExample { public static String ...
2
votes
0answers
360 views

How do you use Named Credentials with a Google Cloud API, which requires a JWT to get a token?

Is it possible to used named credentials with a service account to connect to the Google Cloud Platform? I'm trying to make a client to send Pub/Sub messages to Google Cloud from Apex, and it'd be ...
0
votes
2answers
944 views

Setting Up JWT oAuth Flow

Can someone provide/point me in the direction of detailed instructions to set up a connected app & JWT token for JWT-Based Authorization Flow? Salesforce documentation isn't super clear. I've ...
4
votes
1answer
470 views

Log in to Community with OAuth Access Token

I am getting an access token using JWT Bearer Token Flow. I'm trying to log in to a Community through "frontdoor.jsp" with the token. Looking at this question, it doesn't look possible. But the ...
0
votes
0answers
57 views

Authenticate user to Salesforce based on pre Desktop authentication

I am using OpenID connect flow to authenticate to Salesforce community using a third party Identity provider service. I have configured all settings in Salesforce and it is working fine when initiated:...
2
votes
1answer
358 views

Using the OAuth JWT flow with guest users in a Lightning Community

We're using the JWT flow to retrieve session IDs for the current user in a Lightning Community, for use in code running outside of Salesforce. In particular, we use that session ID to run SOSL queries ...
6
votes
1answer
841 views

Server to Server JWT Authentication Certificate management

I'm writing an application to sync some data from a service to salesforce and back. I'm working with a developer account and so far I was able to implement the bulk of the needed functionality merely ...
1
vote
0answers
379 views

OAUTH 2.0 JWT How can I access request from client side to send JWT token to client application.

I am very new to the Oauth spec. I have done a lot of research but could not find the answer to what I should do. My task is currently my client application is using Salesforce as OAuth provider. So I ...