Questions tagged [jwt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
26 views

Generating and Signing JWT for OKTA API call

I have been working on this for forever now. Need: Call "...oktapreview.com/oauth2/v1/token" to receive a token for use in future calls. I am able to do this with postman just fine, trying ...
Dillon P's user avatar
1 vote
0 answers
55 views

Failed to create a Valid JWT token

I am currently working on sending a request to Snowflake using Key Pair Authentication. They have provided me with a private key and a public key, and for testing purposes, I have hardcoded them as ...
Salvation's user avatar
  • 1,147
0 votes
0 answers
122 views

Programmatically edit authentication parameter of external credentials

I was wondering if updating an authentication parameter of an External Credential was possible from an Apex method. The main goal of this function would be to programmatically store an access token ...
Diaboloxx's user avatar
0 votes
0 answers
62 views

How to use CA Signed certificate in Salesforce Production Org for JWT Authentication in connected app?

We have a requirement to integrate CTI with Salesforce. We want to create a connected app using Digital Certificate. For the development orgs we used Open SSL (https://www.apexhours.com/salesforce-...
Shubham Athalye's user avatar
2 votes
1 answer
85 views

Do scratch orgs have weird behaviors with connected apps? Being given "Invalid_grant" with "user hasn't approved this consumer"

I have created a scratch org and installed a connected app to it. I've set the policy to "Admin Approved users are pre-authorized". I've given the connected app access to a permission set ...
Kiet T's user avatar
  • 21
0 votes
0 answers
120 views

Why is my SESSION_ID invalid immediately after authenticating my JWT token?

So I am trying to get simplesalesforce working in a dev account for proof of concept (and, so far, I've been making a proper mess of it). I have FINALLY managed to successfully connect using a JWT ...
jesse's user avatar
  • 121
2 votes
1 answer
196 views

How Do I Use OAuth2.0 With JWT To Connect To Salesforce?

So I'm trying to get a proof-of-concept together so I can ask my employer for access to our Salesforce (I'm a new employee and very low on the food chain, but their current workflow is just STUPID). I'...
jesse's user avatar
  • 121
0 votes
0 answers
65 views

Jenkins sfdx jwt login issue

So we're using Jenkins to integrate between our Salesforce environments and having an issue with one job in particular. The job copies the code base from our production environment and sends the ...
Finnster's user avatar
1 vote
1 answer
251 views

Retrieve claims from a jwt with apex

I'm trying to retrieve the claims, audience, issuer, subject from a JWT in apex, according to this documentation: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/...
2095377's user avatar
  • 58
0 votes
0 answers
231 views

How to verify a JWT id token signature in an Apex Class

I try to verify a JWT signature in an apex class. It is a RS SHA 256 token. It is an id token received from Auth0. Blob bPublicKey = EncodingUtil.base64Decode(publicKey); Blob bsignature = ...
2095377's user avatar
  • 58
3 votes
3 answers
152 views

Connected App JWT flow fails for custom profile

Our managed package requires a connected app with JWT flow to be configured by the SF admin. The admin chooses the “Admin approved users are pre-authorized” option, creates a custom permission set, ...
ApexAdam's user avatar
  • 163
0 votes
3 answers
731 views

Generate jwt access token for integration user

I am trying to use the new integration user license with the Salesforce API Only System Integrations profile. I created a user with a password and given them a permission set with a type of Salesforce ...
Valeriy Kutsar's user avatar
1 vote
1 answer
408 views

How to configure Salesforce to Salesforce integration using the the JWT Bearer Flow with a certificate via an External Credential?

I'm trying (and failing) to set up a connection between 2 Salesforce orgs. This AITechone video How to configure Named credentials in salesforce to connect 2 Salesforce Org ? explains how to use a ...
Keith C's user avatar
  • 135k
0 votes
0 answers
89 views

How to get Salesforce to support Elliptic Curve Signatures (ECDSA) signatures?

In my production org, when going to the URL xxx.my.salesforce.com/id/keys, I noticed that all the keys (4 keys in total) are "alg": "RS256". I am trying to integrate Salesforce (...
compski's user avatar
  • 1,251
0 votes
0 answers
158 views

Help getting JWT Auth working - gettin unsupported_grant_type no matter what I try

Every example I have found is working against login.salesforce.com or test.saleforce.com, but I don't have access to either of those for my particular project, yet? I am working in developer sandbox ...
digidigo's user avatar
  • 113
1 vote
2 answers
1k views

JWT Security Best Practice with Certificate

Any security experts here? We have built out a JWT authentication flow with a client, but they keep asking for more and more information. So far we have provided: Client ID Client Secret server.key (...
Chance's user avatar
  • 1,050
0 votes
0 answers
130 views

invalid_grant: user hasn't approved this consumer

(Note: I see several similar questions here, but I believe I've tried all the suggested answers.) I'm doing JWT authentication with a Salesforce app, for a single user. It worked until our test ...
JW.'s user avatar
  • 101
0 votes
1 answer
196 views

JWT Access token in salesforce

I'm struggling with a requirement. I have to generate an access_token with "header" and "payload" information encoded inside the value of the token, all of this using salesforce. I ...
Juan Antonio Flores's user avatar
0 votes
1 answer
159 views

Setting up per user JWT claim Named Credential

I'm trying to setup a per-user JWT claim as per the documentation here the issue is it specifies Subject of the token (the user). The subject is a string when the identity type is named principal, ...
KarlLivesey's user avatar
0 votes
0 answers
147 views

SF as authorization service for 3rd party API

We have an external website that is using Salesforce Identity to authenticate and authorize access to an API. We have setup the Oauth2 flow using PKCE as per the following link. https://help....
CloudingAround's user avatar
1 vote
0 answers
92 views

Overwrite Expiration date in Portal JWT responses

I'm having a security problem with my portal users. When they login into the portal from a VisualForce page using the Site.login() we are receiving in the browser 48 JWTs without an expiration date. ...
Nicolas Caro's user avatar
0 votes
0 answers
140 views

Acquire access token via oAuth from Azure Active Directory

I'm using Crypto.signWithCertificate with a certificate in the Certificate and Key Management area. The platform I'm accessing (AAD) requires thumbprint of the certificate as part of the client ...
fartwhif's user avatar
  • 101
1 vote
1 answer
900 views

Crypto.sign() SecurityException: Invalid Crypto Key [closed]

The following should be immensely helpful for people looking to construct JWTs in Apex in a much simpler way than provided in many online examples: I've been going through the joys of learning to ...
number41's user avatar
  • 928
0 votes
1 answer
128 views

Is there a way to generate sfdx auth url for scratch org if devhub is authorized using the jwt bearer flow?

In our CICD pipelines, we used to authorize devhub first using sfdx auth url and then create scratch orgs using same devhub. We use the command "sfdx force:org:display --verbose" to get the ...
Sarang123's user avatar
0 votes
0 answers
330 views

Manually set or change header properties in JWT

I am running into an issue in developing for JWT Server -> Server workflow. I can use the JWT class to set properties in the Payload of the JWT with methods like setSub, setAud etc. However, when I ...
markwilland's user avatar
0 votes
0 answers
199 views

oAuth JWT flow for multiple users

I've only ever used the JWT flow for server to server integrations with a hardcoded specific user. Is it even recommended to use it with multiple users where we dynamically inject the username into ...
Tiago Lopes's user avatar
1 vote
1 answer
208 views

Why has pipeline JWT auth started erroring with 'Value is not a JsonMap'?

The GitLab pipeline was running successfully until a few days ago. Nothing has been changed as far as we're aware, but it now fails on the authentication step with "We encountered a JSON web ...
MikeA's user avatar
  • 1,055
0 votes
1 answer
149 views

How can I resolve ampscript variables in the @json payload when using GetJWTByKeyName ampscript function?

I want to configure a script that will dynamically populate variables in the @json payload of the GetJWTByKeyName ampscript function, based on the user data. I know the blow script isn't valid, but ...
en-rep's user avatar
  • 25
2 votes
0 answers
166 views

Connected App Using Server To Server JWT OAuth Can Only Have One Session At A Time

I have a connected app that I authenticate to from multiple servers using the same IP in my data center. (This Salesforce org is setup to only allow IPs in the allowlist - which ours is in.) The first ...
Adam's user avatar
  • 121
0 votes
1 answer
84 views

Connect to Doordash API From Salesforce Apex - JWT Help

I keep getting 401 status code returned, but using Postman it works fine, so I think I am missing something in the JWT Creation. There are not a lot of examples I can find, so hoping one of the ...
Dar Wright's user avatar
0 votes
0 answers
690 views

How do I import a JKS where I do not have the private key

The public cert is issued by the claims provider. It is for custom apex JWT verification. I get an error when uploading: "Error: No certificate was imported because the keystore file doesn't ...
K A's user avatar
  • 1
1 vote
1 answer
539 views

Salesforce CDP Ingestion API: 401 Invalid JWT Token Format Error

I'm trying to implement the OAuth 2.0 JWT Bearer flow for CDP Ingestion API Connected App. Below are the steps and here's the help doc reference - https://help.salesforce.com/s/articleView?language=...
Namita V's user avatar
0 votes
1 answer
2k views

ECONNRESET when authenticating via sfdx auth:jwt:grant

I have configured below pre-requisites for JWT based authentication to Salesforce sandbox. ConnectedApp server.key Client Id I am trying to authenticate Salesforce sandbox from client's Jenkins ...
Swapnil Shrishrimal's user avatar
0 votes
1 answer
711 views

Apex REST API call throws 401 error, status: token expired or invalid [closed]

I am trying to call external REST API from Salesforce. Sometimes I get error 401 with messages token expired or token invalid. Is there a way to prevent calling API when token is not valid. The thing ...
crazyDev's user avatar
0 votes
1 answer
669 views

Validate String JWT using Apex [closed]

I have generated JWT token. I added it as String argument in one method I have to call. Is there a way to validate that String token if it is expired, valid, etc?
crazyDev's user avatar
2 votes
1 answer
155 views

How often does Salesforce change the keys at https://login.salesforce.com/id/keys?

How often does Salesforce change the keys change at https://login.salesforce.com/id/keys ? Context A client wants to verify the JWT signature generated for Salesforce's OpenID Connect token However, ...
Rob's user avatar
  • 2,112
0 votes
0 answers
86 views

Where i can see jwt token passed or not to end points in journey builder custom activity

Where I can see jwt token passed or not to end points in journey builder custom activity, JWT not included in payload for Custom Activity endpoints
Chalamala Karthik's user avatar
0 votes
1 answer
86 views

Multiple digital signatures against one app

Is it possible to set up multiple valid Digital Signatures against one app? as stated in the title? When we get to cert expiry dates converting the changeover is such a pain it would be nice if I ...
KarlLivesey's user avatar
1 vote
0 answers
111 views

We have recently migrated to govcloud+ and no longer able to authenticate to scratch org using jwt from devhub as part of our CI

Below is our auth approach into scrath orgs to allow us to login and serve them as part of a "scratch-org-pool-service". export SFDX_AUDIENCE_URL="https://test.salesforce.com" echo ...
jschleicher's user avatar
0 votes
0 answers
672 views

JWT - loading a private key from Certificates and Key Management

I am trying to use JWT and I am getting error at jws.getCompactSerialization(); What am I missing. BOXJWT is Selfsign certificate. Map<String, String> extraClaims= new Map<String,String>();...
Ajay 's user avatar
  • 1,539
0 votes
0 answers
60 views

Generate JWT for calling out to Snowflake [duplicate]

Trying to create a custom integration from Salesforce to Snowflake and they provide a python snippet, which can be seen here, that is able to generate a jwt to gain authorization. I'm trying to ...
SFDC Noob's user avatar
  • 378
2 votes
1 answer
674 views

Named credential JWT is not appearing in Authorization header in callout

I've configured a Named Credential to use the JWT authentication protocol (not JWT Token Exchange), but when the component makes a call to my service using the named credential, I don't get the JWT as ...
sea-rob's user avatar
  • 73
2 votes
1 answer
989 views

error in node JS and SF integration via jsforce using JWT

Premise: I need to integrate SF with NodeJs using JWT. I'm following Salesforce Developers Session for this purpose. As of now the entire setup of NodeJs is only in local. According to the video I ...
user43598's user avatar
  • 447
0 votes
1 answer
563 views

Send JWT token with External Data Source for Odata v4 endpoint in header

I am trying to Authenticate the Calls to My Odatav4 , In My Service I have started accepting JWT token in header and it is working if i call the service in postman with JWT token in header, Now in my ...
Arjun Shrivatsa's user avatar
0 votes
1 answer
583 views

Username/password JWT with Salesforce Named Credentials

I need to integrate with a service that uses an authentication flow I'm not familiar with and wondering can I use Named Credentials with it? The flow requires that I first get a JWT token by passing a ...
Diego's user avatar
  • 405
1 vote
1 answer
268 views

Access token doesn't change with JWT flow

I have a connected app to use the JWT flow and I generate the access token with sfdx force:auth:jwt:grant command. I noticed that the obtained token is always the same even after a day. I would expect ...
Nicholas's user avatar
  • 177
0 votes
0 answers
511 views

invalid_grant invalid assertion POST /services/oauth2/token

I followed up this guide and I believe I did it correctly. However I'm receiving this error from POSTMAN POST /services/oauth2/token HTTP/1.1 User-Agent: PostmanRuntime/7.28.4 Accept: */* Postman-...
mario ruiz's user avatar
3 votes
0 answers
347 views

Does APEX language support ES256 algorithm?

I'm trying to implement social login via Apple. When requesting an access token, I get an "invalid_client" error. I found that one cause for this issue is a bad-formatted JWT, which is ...
David Kohelet's user avatar
2 votes
2 answers
265 views

SF required multi-factor authentications starting February 2022 OAuth JWT Bearer Token flow

I am using JWT flow described bellow https://help.salesforce.com/articleView?id=sf.remoteaccess_oauth_jwt_flow.htm&type=5 and SF required multi-factor authentications starting February 2022 ...
Vlad Bolibruk's user avatar
-2 votes
1 answer
702 views

Salesforce to an external Service callout using JWT [closed]

Hi Community Members, The ask is to call a service, from Salesforce that will accept only requests that are based on JWT. Precise wording is Salesforce sends an encrypted JWT object containing the ...
Shobhit Saxena's user avatar