Skip to main content

Questions tagged [jwt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
178 views

How to migrate successfully from legacy FCM APIs to HTTP v1 in apex?

I have a working functionality for sending push notifications via Firebase (FCM) from apex. But it is legacy now and I need to upgrade to HTTP v1. Based on the official documentation and the few ...
unique user's user avatar
0 votes
0 answers
22 views

INVALID_SESSION_ID with metadata api login

I'm trying the metadata api in java using this sample code - https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_quickstart_java_sample.htm Instead of the basic ...
jacksparrow007's user avatar
0 votes
0 answers
56 views

Google Cloud Connection Works with Apex Auth Class but not with Named Credentials

I have hosted an API on google cloud run and the downloaded the service account credentials in below format. { "type": "service_account", "project_id": "...
aloomatar's user avatar
0 votes
0 answers
30 views

Can name/external credentials handle wrapped jwt?

the endpoint I'm authenticating with returns a Json response which contains the Jwt as a property of the Json. For example... { "id":"1234567890", "jwt": "Json ...
user432024's user avatar
0 votes
1 answer
83 views

request to services/oauth2/token responses with 'invalid_client_id'

What i've already done: Created Connected App Generated self-signed certificate Provided cert to app Changed Policy to 'Admin approved users' Provided Profile to app, created user with this profile ...
pincet's user avatar
  • 919
0 votes
0 answers
43 views

SSO into community experience site from a custom third party IdP using JWT Token

I'm trying to setup SSO login for customers into one of our Salesforce digital experience sites. The IdP is a third party custom solution that generates a JWT token. SAML isn't currently an option. I'...
Jay Mclaughlin's user avatar
0 votes
1 answer
57 views

sf auth:jwt:grant hanging - no terminal output

I have been working on creating a CICD pipeline with my developer org and github actions. I have done the following: Connected app created Profile added to connected app with API permissions. User ...
smedium's user avatar
0 votes
1 answer
46 views

Should an Access Token be renewed for every call using JWT?

Using the OAuth 2.0 JWT Bearer Flow, when does the Access Token need to be renewed? Let's say the JWT Flow is used to send queries to Salesforce from time to time. Should one request a new Access ...
Z0q's user avatar
  • 91
1 vote
1 answer
87 views

Using a ConnectedApp to create a signed JWT from Apex (similar to Canvas Signed Request Authentication)

Our 2GP has an Aura component with a Canvas App that uses a Connected App to authenticate the Salesforce organization against an external service using the JWT Bearer OAuth flow. Current flow follows ...
nstuyvesant's user avatar
0 votes
1 answer
172 views

Can we store a signing key in a Named Credential and use it via apex to generate a new JWT token

I have a requirement where I need to generate a new JWT token for authentication but we cannot hard code the signing key in apex or store the signing key in a Custom Metadata or Settings. So wanted to ...
Maverick's user avatar
0 votes
0 answers
136 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
121 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,189
0 votes
1 answer
589 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
  • 101
0 votes
0 answers
130 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
3 votes
1 answer
250 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
  • 31
0 votes
0 answers
412 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
471 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
1 vote
1 answer
470 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
431 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
259 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
1 vote
3 answers
1k 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
776 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
  • 136k
0 votes
0 answers
138 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,352
1 vote
0 answers
262 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
  • 123
1 vote
2 answers
3k 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,070
0 votes
1 answer
349 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
222 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
187 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
100 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
185 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
2k 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
  • 980
0 votes
1 answer
167 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
543 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
218 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
311 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,105
0 votes
1 answer
212 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
203 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
98 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
1k 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
744 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
3k 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
830 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
851 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
174 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,132
0 votes
0 answers
99 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
183 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
125 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
748 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,609
0 votes
0 answers
61 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
810 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