Questions tagged [jwt]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
62 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 ...
user avatar
0 votes
1 answer
53 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?
user avatar
2 votes
1 answer
48 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, ...
user avatar
  • 2,092
0 votes
0 answers
29 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 ...
user avatar
  • 335
0 votes
0 answers
88 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 ...
user avatar
0 votes
0 answers
29 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
user avatar
0 votes
1 answer
28 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 ...
user avatar
1 vote
0 answers
41 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 ...
user avatar
0 votes
0 answers
107 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>();...
user avatar
  • 1,393
0 votes
0 answers
48 views

How do i get certificate's public key to validate JWT token in client app (Generated via NamedCredential)

For our setup, We are making outbound call from customer's salesforce to our external service. For authentication, we are using NamedCredential using JWT. To validate this JWT token on the external ...
user avatar
  • 101
0 votes
0 answers
124 views

JWT Authentication Flow debug and how to call from Postman (for debugging)

There's an existing Salesforce org with a Community Site. There's an error when user logs in and after which I believe it hands off to Angular for further user experience. In Salesforce logs I see the ...
user avatar
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 ...
user avatar
  • 348
2 votes
1 answer
252 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 ...
user avatar
  • 73
2 votes
1 answer
198 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 ...
user avatar
  • 405
0 votes
1 answer
222 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 ...
user avatar
0 votes
1 answer
71 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 ...
user avatar
  • 255
1 vote
1 answer
121 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 ...
user avatar
  • 177
0 votes
0 answers
98 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-...
user avatar
2 votes
0 answers
166 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 ...
user avatar
2 votes
2 answers
218 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 ...
user avatar
-2 votes
1 answer
98 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 ...
user avatar
-2 votes
1 answer
188 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....
user avatar
0 votes
1 answer
133 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 ...
user avatar
  • 7,543
0 votes
1 answer
528 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","...
user avatar
  • 19
1 vote
0 answers
85 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 ...
user avatar
  • 19
1 vote
1 answer
258 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 ...
user avatar
2 votes
2 answers
268 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 ...
user avatar
  • 5,724
0 votes
0 answers
63 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 ...
user avatar
  • 620
1 vote
1 answer
140 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 = ...
user avatar
2 votes
1 answer
130 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 ...
user avatar
  • 17
2 votes
1 answer
2k 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 ...
user avatar
  • 598
1 vote
0 answers
85 views

Pass JWT Token (ID Token) when calling external System using Salesforce Connect

We are working on a Integration to get data from an external system using Salesforce Connect. The high level flow is Salesforce (Connect) -> APIGEE -> Legacy System For Authentication - We are ...
user avatar
0 votes
1 answer
212 views

Automatically Login via SSO Connected App

I'm trying to teach myself IAM areas I'm weak on. I have 2 dev ed orgs.Org A - is the IDP Org B - is the SP I have created the SSO settings in Org B to use Org A as the IDP.In Org A, I have created ...
user avatar
5 votes
0 answers
209 views

JWT Token Exchange setup in Named Credentials for outbound callout

Trying to integrate with okta api from Salesforce that supports JWT Token exchange. I was able to successfully get the access token with the below code but I am blocked on how to use named credentials ...
user avatar
  • 341
0 votes
0 answers
158 views

Access REST API with Connected-App and JWT Bearer Token Flow

I read this article and created php demo script. https://help.salesforce.com/articleView?id=sf.remoteaccess_oauth_jwt_flow.htm&type=5 Environment: Sandbox OAuth Scopes: api, refresh_token, ...
user avatar
  • 1
0 votes
0 answers
237 views

Using Named Credentials with an endpoint running on my machine

I am trying to generate a JSON Web Token(JWT) via named credentials as per user. I want to use this named creds for authentication purpose. So that using them after salesforce providing JSON web token,...
user avatar
0 votes
1 answer
1k views

How to generate signed JWT token in Apex using JWK keyset

How to generate signed JWT token in Apex using JWK keyset. I know Auth.JWS can be used to generate bearer token. JWS(jwt, certDevName) but it uses certificate to generate token. My requrement is ...
user avatar
  • 1
0 votes
1 answer
210 views

Generate a JWT with Apex to call a web service from another system [duplicate]

I develop an Apex class wich calls an web service from another system. I need to use a JWT to make the authentication but I never used it, so I don't know how to do it. I read the Salesforce ...
user avatar
  • 617
0 votes
0 answers
90 views

How to access JWT in registration handler using Auth provider (open id)

In our org we have an open Id auth provider setup that works fine along with the registration handler. The only issue is we are receiving only the email currently from the provider in the auth....
user avatar
2 votes
1 answer
867 views

Allow external users to access customer community SSO/JWT

Use Case: Coming from the client website, the external users need to be log into their customer communities account without having to log again. I know that I could use SAML for this use case, but ...
user avatar
  • 223
1 vote
1 answer
302 views

Generate JWT token for external app

We are setting up a Salesforce Community and our community members should be able to automatically login using the credentials from an extenal platform when clicking on a link from this platform. I'm ...
user avatar
  • 223
0 votes
1 answer
428 views

Can Marketing Cloud generate JWT tokens in AMPScript?

As the title suggests, I need to make a callout to an external service but must sign the request with a JWT token (using a private key). Is this possible?
user avatar
1 vote
1 answer
144 views

OAuth 2.0 JWT Bearer Flow - XMLHttpRequest CORS and SameSite error and Gack

We are implamenting a chatbot using the OAuth 2.0 JWT Bearer Token Flow and see the above errors in the browser client degugger. We already have a valid access token and the origin has already been ...
user avatar
0 votes
0 answers
123 views

Ant validation/deployment errors using sessionId

I have a weird problem with Ant setup on CI. I have a script that fetches access token using JWT. The token is retrieved successfully, and when I want to use it with Ant deployment (switching in ant ...
user avatar
7 votes
0 answers
665 views

sfdx force:auth:jwt:grant failure user hasn't approved this consumer - cross machine

This is related to How to open a scratch org created in another machine but posed somewhat differently Given: DevHub with Connected App defined using a digital certificate Correct Oauth scopes ...
user avatar
  • 62.2k
1 vote
0 answers
115 views

Is there a way to convert JWK to x.509 cert in Apex salesforce

Is there any way in APEX Salesforce to convert JWK to x.509 cert so that the Crypto class can be used to verify another JWT ?
user avatar
  • 997
3 votes
2 answers
2k views

Named Credential with JWT Token Exchange for authorizing calls to Google Cloud

I can make requests with Bearer from Auth.JWT: Auth.JWT jwt = new Auth.JWT(); jwt.setSub('service-portal-rlj@appspot.gserviceaccount.com'); jwt.setAud('https://accounts.google.com/o/oauth2/token'); ...
user avatar
1 vote
0 answers
451 views

Cannot connect to sandbox using JWT

I connected to Production Org with JWT through connected app without any difficulty. However, by applying the same procedure, I could not connect to Sandbox using JWT. Here is my command: sfdx force:...
user avatar
0 votes
0 answers
64 views

ID Token from OpenId Connect

We are using OpenId Connect for SSO into a Community with an external Identity Provider. It is easy to get the Access Token returned via AuthToken.getAccessToken. Is there any way get the ID Token (...
user avatar
1 vote
2 answers
4k views

Authorization via JWT yields an "invalid assertion" error

I failed to request an access token. Following doc to authentification using JWT, I already have my connected app, my JWT Key so I just need to make a POST requestion to : https://test.salesforce.com/...
user avatar