Questions tagged [jwt]
The jwt tag has no usage guidance.
169
questions
0
votes
0
answers
46
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 (...
0
votes
0
answers
47
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 ...
1
vote
1
answer
81
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 (...
0
votes
0
answers
47
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 ...
0
votes
1
answer
87
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 ...
0
votes
0
answers
41
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, ...
0
votes
0
answers
54
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....
1
vote
0
answers
71
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.
...
0
votes
0
answers
87
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 ...
1
vote
1
answer
236
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 ...
0
votes
0
answers
68
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 ...
0
votes
0
answers
37
views
Create static resource file from managed package [duplicate]
I have a managed package in which I'm using Metadata API to create a Static Resource file on the user's Salesforce org.
Code snippet to create Static Resource file,
MetadataService.MetadataPort ...
0
votes
0
answers
96
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 ...
0
votes
0
answers
96
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 ...
1
vote
1
answer
116
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 ...
0
votes
1
answer
80
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 ...
2
votes
0
answers
90
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 ...
0
votes
1
answer
67
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 ...
0
votes
0
answers
279
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 ...
1
vote
1
answer
232
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=...
0
votes
1
answer
814
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 ...
0
votes
1
answer
492
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 ...
0
votes
1
answer
367
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?
2
votes
1
answer
104
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, ...
0
votes
0
answers
33
views
Web app and two Salesforce orgs working as IDP and SP
Currently we have two Salesforce orgs, one of them is IDP, and second SP. Community Users login to Org 1 and use community resources on Org 2.
Now we would like to create external WebApp. Between Web ...
0
votes
0
answers
354
views
Named Credentials JWT created with invalid signature using Microsoft as Auth Provider
We need to make an authenticated call to an external endpoint with Named Credentials created on Salesforce using a Microsoft account with Oauth 2.0.
To do that, we created an Azure project in order to ...
0
votes
0
answers
65
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
0
votes
1
answer
35
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 ...
1
vote
0
answers
72
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 ...
0
votes
0
answers
440
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>();...
0
votes
0
answers
55
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 ...
2
votes
1
answer
451
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 ...
2
votes
1
answer
626
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 ...
0
votes
1
answer
440
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 ...
0
votes
1
answer
280
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 ...
1
vote
1
answer
202
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 ...
0
votes
0
answers
300
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-...
3
votes
0
answers
231
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 ...
2
votes
2
answers
247
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
...
-2
votes
1
answer
358
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 ...
-2
votes
1
answer
709
views
Redirecting to an external page using JWT
I am required to redirect a user to an external payment gateway, from a visualforce page. Apart from just the redirection, sensitive information is to be passed to the external gateways, and using JWT....
0
votes
1
answer
239
views
Salesforce oAuth JWT Integration
We have provided salesforce self signed certificate to external system for oAuth JWT integration with salesforce. when they hit salesforce they get the below error
What does this error mean and how to ...
0
votes
1
answer
1k
views
{"error":"invalid_grant","error_description":"invalid assertion"} I want to send post request to Salesforce [closed]
I am trying to send post request to salesforce for Oauth by using JWT and I wrote it like the one below, but I got an error that says {"error":"invalid_grant","...
1
vote
0
answers
243
views
JWT authentication parameter error
I am currently working on the project that I am going to integrate the application of my company and salesforce.
In my case, it seemed that using the JWT for authentication is better. So, I wanted to ...
2
votes
1
answer
476
views
Using JWT As authentication Protocol in Named Credentials for External Service
As a part of my project work, I need to connect to Azure Logic App via External Service in Salesforce.
I know the prerequisite is to create Named Credentials first.
I have chosen following in setting ...
2
votes
2
answers
792
views
SessionID access vulnerability found when using Metadata API
Salesforce is performing manual security review in our package. They have found SessionID access Vulnerability in one of our file where we are using Metadata API to grant permissions on profile and ...
0
votes
0
answers
193
views
Community SSO using JWT
We are setting up a Salesforce Community and our community members should be able to automatically login from 3rd party and at their end they will create the JWT payload and via connected app ...
1
vote
1
answer
273
views
OAuth2.0 JWT bearer token flow with alg HS256 issue
I have written the below python code for JWT integration:
from datetime import datetime
import jwt
import time
import requests
# *** Update these values to match your configuration ***
IS_SANDBOX = ...
2
votes
1
answer
245
views
OAuth JWT Bearer Flow and Managed Packages
Does anyone know if the Certificate uploaded to a Connected App in my Dev org will be installed automatically to all customers through a Managed Package?
Right now I have a small analytics app that I ...
3
votes
1
answer
4k
views
Error authenticating with JWT config due to: audience is invalid
I've created a connected app based on this Trailhead project. Note that this isn't about a trailhead project I'm using what I've learned from Trailhead in a real-world project to implement CI/CD for ...