Questions tagged [jwt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
22 views

OAuth 2.0 JWT Bearer Token Flow - “error”:“unsupported_grant_type”

I am trying to use the OAuth 2.0 JWT Bearer Token Flow to get my access token for future api requests using Python 3.7 but I am receiving the following error: {"error":"unsupported_grant_type","...
0
votes
1answer
29 views

Named Credentials - What is the difference between JWT & JWT Token Exchange

When setting up a named credential with Identity Type as Named Principal, two options are shown for JWT : JWT & JWT Token Exchange Could anyone explain what is the difference between the two? ...
0
votes
0answers
34 views

Securing endpoint with JWT Token

I have a requirement where I have integrated an external endpoint with Salesforce so that the data will be sent whenever the status of any account record is updated. The POST call is working fine but ...
0
votes
1answer
40 views

Create self-signed x509 certificate

I am trying to get an access token by following the guide OAuth 2.0 JWT Bearer Token Flow. But I am stuck on the following The developer writes an app that generates a JWT. The JWT is signed with ...
1
vote
1answer
70 views

Unable to make /login POST call from application of marketing cloud

I'm working on building the application on the salesforce marketing cloud and facing the issue of making POST /login call to application. Scenario: We have created a cloud application in Installed ...
2
votes
2answers
93 views

JWT HS256 Signature Issues

I am trying to generate an HS256 signed JWT token via apex. I am using this token in the Authy registration process to enable 2FA for community users. Per the authy documentation HS256 is the only ...
0
votes
1answer
79 views

JWT Bearer flow vs. Username+Password flow in server-to-server integration

Official documentation and some SFSE answers advise against the use of Username + Password flow (Resource Owner Password Credentials Grant in oauth). The JWT Bearer flow is also recommended as a ...
2
votes
0answers
128 views

Does SFDX jwt authorization work for scratch orgs as well?

According to the documentation available here https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_auth_jwt_flow.htm it is explicitly mentioned that: You can authorize ...
2
votes
1answer
59 views

JWT Token always expires after 'exp' provided in the claims

I've tried implementing a JWT Bearer Token Flow. I followed the documentation on here. The code is originally in Java but I managed to adapt it to c# as the code below shows. String header = "...
0
votes
1answer
37 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
550 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
81 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
144 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
32 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
79 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/...
5
votes
1answer
134 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
25 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
64 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
70 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
118 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
65 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
99 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
244 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
116 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 ...
5
votes
1answer
908 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
630 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
379 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
310 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 ...
1
vote
0answers
253 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 ...
2
votes
1answer
258 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
47 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 ...
1
vote
1answer
1k 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
205 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
231 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 ...
6
votes
3answers
524 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
93 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
969 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....
3
votes
2answers
894 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
198 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 ...
8
votes
1answer
6k 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 ...
1
vote
1answer
178 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
196 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
289 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
6k 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
183 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
878 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
467 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 ...
6
votes
0answers
440 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
444 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
1k 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 ...