Questions tagged [namedcredentials]
The namedcredentials tag has no usage guidance.
355 questions
0
votes
0
answers
33
views
Connected app OAuth2 and Named credentials used in salesforce rest callout to create/access record in same org only. But receiving 302 status?
We are trying to create product schedule using rest api and for Oauth2 Authentication ConnectedApp, Auth Provider, Named Credential. When we made callout using named cred it is showing 302 status and ...
0
votes
0
answers
24
views
Passing Autherization Token from Apex to Salesforce External Services method
I am using External services for integration. I've created Named Credentials, External Named Credentials, External Services Utilized Custom API.
In 1st method call I'll be getting Authentication token ...
0
votes
0
answers
38
views
Using Named Credentials for WhatsApp authentication with permanent token
To connect SF with WhatsApp, namely to send messages on WhatsApp, I used permanent token generated on the WhatsApp side. I saved it in protected custom setting (in the future there will be a managed ...
0
votes
0
answers
50
views
Callout exception - OAuth token error
I am trying to call an API that requires Client credentials flow for token generation. I have configured external credentials and also configured named credentials using the external credentials ...
1
vote
1
answer
64
views
How to determine which Profiles have access to an External Credential Named Principal
Under the new Named Credentials model, access is granted to the underlying External Credential using Named Principals; as of API 59.0 these can be granted to Profiles or Permission Sets. The Metadata ...
0
votes
2
answers
54
views
ConnectApi.NamedCredentials.getNamedCredential method not working for non admin users
I'm using ConnectApi.NamedCredentials.getNamedCredential() method to get the details of the named credentials in apex.
For an admin user, the code is working fine from the Execute Anonymous window of ...
1
vote
0
answers
49
views
Named/External Credentials and grant_type=account_credentials for Zoom API
I'm building a Salesforce > Zoom API integration. I have apex classes that handle oAuth and the API calls, but my client id/ secret are just hardcoded in there at the moment.
I obviously need to ...
1
vote
1
answer
105
views
Calling the org itself with a named credential still results in a 401 HTTP response with INVALID_SESSION_ID error, but why?
I'm trying to obtain a valid session id to save time and resources on a feature I'm working on. I have a middleware that is supposed to receive requests from Salesforce and then perform calls back to ...
1
vote
0
answers
32
views
PMD Security - ApexSuggestNamedCredential Violation for Experian Integration on OAuth 2.0
We encountered a security issue flagged as "ApexSuggestNamedCredential" on various Experian-related integrations (such as Commercial Credit, Business Search, etc.).
To address this, we ...
1
vote
1
answer
104
views
Can't access named credential connecting to another salesforce org
I'm having trouble using a named credential to connect to another salesforce org. I get the error "We couldn't access the credential(s). You might not have the required permissions, or the ...
0
votes
0
answers
71
views
Access Named Credentials from Site Guest User
I'm trying to assign access to a Named Credential to a site guest user.
I've done some searching and found two different set of steps to do this put neither of them works.
First I tried to create a ...
0
votes
2
answers
129
views
How to catch "System.UnexpectedException: Unable to fetch the OAuth token."
I have a Queueable class that makes a callout using Named Credentials. Sometimes I get
System.UnexpectedException: Unable to fetch the OAuth token.
I surrounded the send method with try/catch block
...
1
vote
2
answers
128
views
Get all named credentials using connectAPI
I am trying to pull the namedcredentials using getNamedCredentials() method in apex but it's not working in anonymous window. This is the error I am getting.
error:
Method does not exist or incorrect ...
0
votes
0
answers
79
views
Get Named Credential to use local url or override the URL
I have a connected app that can be configured with a named credential, allowing users to send API messages to their respective Salesforce orgs. However, I'm concerned that each time I transition from ...
0
votes
0
answers
28
views
Editing Managed Package new Named Credential (not legacy) URL in subscriber org
I'm looking to add a new Named Credential (not legacy) to my managed package. There's a similar question here, but that's in relation to legacy named credentials.
Looking at the documentation, it ...
0
votes
0
answers
18
views
How to use Named Credential when apiKey is part of endpoint? [duplicate]
We are using the HERE api to retrieve geolocations. We had the API Key hardcoded, and yes, of course this is wrong. We want instead use a Named Credential.
Using below endpoint works:
String address = ...
0
votes
1
answer
60
views
Is populating external credentials from VF using connectAPI safe from security review?
I'm packaging the permissions, principals, namedcredentials and externalcredentials with the managed 2gp
However I'm not packaging the external credential principal secret i.e. APIKey for the callout
...
0
votes
0
answers
29
views
Authorize external credential in partner community
In lightning experience a user can allow access to an external credential via OAuth through Settings > External Credentials. I'm trying to find a way for Partner users to do the same in a partner ...
0
votes
0
answers
72
views
External Credentials - implement custom auth scheme
To authenticate in an external services, I have to run this requests :
curl 'https://SERVICE_URL/v2/authenticate' \
-X POST \
-H 'Bridge-Version: 2021-06-01' \
-H 'Content-Type: ...
0
votes
1
answer
49
views
Salesforce Managed 2GP Setup for NamedCredentials with External Credentials
Objective: Create Salesforce Apex package to be distributed, as an integration with a third party service
Development Details: API v61 (Summer 24), SF CLI
Development Steps: Following the workflow ...
0
votes
0
answers
89
views
How to Address Security Warnings About Named Credentials When Handling OAuth in Apex?
I am preparing to submit my Salesforce application for review to list it on Salesforce AppExchange. My application uses a custom OAuth authentication flow handled by an LWC component and Apex. The ...
0
votes
0
answers
180
views
How to use Named Credential + External Credential for Marketing Cloud Transactional Messaging API
I am trying to use Named Credential for Marketing Cloud Transactional Messaging API. And I am having issues sending SMS.
I was able to setup an External Credential:
Authentication Protocol = OAuth 2.0
...
0
votes
0
answers
99
views
Named + External Credentials issue: Getting 502 error when access token for external system has expired
I'm new to the named credentials + external credentials combo. My task is to integrate with an external system using these features using client credentials flow and OAuth2.0.
I was able to get it ...
0
votes
0
answers
239
views
Named Credential - Refresh access token when not 401?
I'm trying to connect to an external system using legacy Named Credential and a custom Auth. Provider (with AuthProviderPlugin class).
I'm able successfully call the endpoints when the access token is ...
0
votes
0
answers
36
views
Can we put external credentials in a managed package? [duplicate]
I need to put a named credential and external credential in my managed package that I create. Furthermore, if not possible like this is it possible to create via the postInstall script??
1
vote
0
answers
591
views
System.CalloutException: The callout couldn't access the endpoint
I have created an Apex REST endpoint and I want to test it using an integration user that I've also just set up. The integration user is using the "Salesforce Integration" User License.
I've ...
0
votes
0
answers
217
views
Updating External Credential Principal's Client Id and Client Secret via Apex
Using Apex, trying to:
Create an External Credential for Client Credentials with Client Secret Flow
Add a Principal with a Client Id and Client Secret
Associate it with an existing Named Credential
...
1
vote
0
answers
60
views
Invoking a Per User Named Credential OAuth flow on click of a button
Here is my use Case.
I am trying to connect Salesforce with another Salesforce org with Per User Identity Type.
The Second Salesforce org is just to demonstrate that the process works and will ...
1
vote
0
answers
125
views
How to convert Legacy Named Credentials to new External Credentials?
I have a set of legacy named credentials connecting from one SF org to another, using OAuth2 protocol.
Legacy credentials don't specify the Authentication Flow Type.
Instead, they attempt to log in to ...
2
votes
0
answers
692
views
How can I retrieve custom parameters from External Credentials with Apex?
I'm looking to retrieve some External Credential information in an Apex class, and so far I've been successful in retrieving everything except for the parameters associated with the credential's ...
0
votes
0
answers
63
views
What is the authorization token format in a callout using Named Credentials with the OAuth 2.0 Browser Flow?
I'm making a callout to our backend using Named Credentials with the OAuth 2.0 Browser Flow. After setting it up, I ran a test in the Developer Console.
Here's the log:
15:49:02:346 ...
1
vote
1
answer
56
views
How to set scope in Auth provider for extending token expiry on JIRA server?
While setting up named credentials or Auth provider using OAuth2 for connecting to Jira on premise, The incoming link in JIRA is configured correctly and I am able to pull data but the session expires ...
0
votes
0
answers
81
views
HMAC signing with Named Credentials and OAuth
Context
I'm setting up an External Data Source pointing to an OData API.
I've setup a Named Credential and an External Credential for it.
The External Credential is configured to use OAuth2.0 (JWT ...
0
votes
0
answers
67
views
Issue with passing UTC time as Custom Header - Named Credentials
I have set up a named credential to call an external system and this need few Authorization headers for Authentication. One of the parameters related to Authentication is passing the current time in ...
0
votes
0
answers
941
views
Authenticated User "Unable to tunnel through Proxy..."
I have a connection between a Dev Box and a Full Box instance. I set up this way:
Fullbox - Connected App
Dev Box
--> Named Credentials Uses Auth provider with login flow on save.
--> Auth. ...
2
votes
1
answer
479
views
Safely Storing Client Credentials in Salesforce?
I'm trying to integrate with an external system using Authentication provider and Named credential.
For this, I've created an Auth. provider with just Auth URL, Callback URL and a plugin class. Client ...
0
votes
0
answers
333
views
Difficulty Updating Named Credential Parameters via Metadata API in Salesforce
I'm encountering difficulties updating a Named Credential using the Metadata API in Salesforce. Below, I've outlined the steps I've taken to create the Named Credential and provided the code snippet I'...
0
votes
0
answers
51
views
Seeking Best Practices for Authentication Setup Using Named Credentials
I'm currently working on implementing authentication using Named Credentials in my project.
I'm looking for insights into the best practices widely used in the industry to ensure comprehensive ...
0
votes
0
answers
149
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": "...
1
vote
1
answer
436
views
Access Named Credentials with Guest User
I have created a Rest Service which accepts incoming Webhooks from Concur to notify Salesforce an Expense Report is ready. I am then using a Callout Class to fetch the Expense Report details from ...
2
votes
1
answer
686
views
How do you correctly populate an External Credential from a Principal for a Named Credential?
In Salesforce, I want to consume a web API which I can successfully call from my command line like:
curl --location 'https://dummyapi.io/data/v1/user?limit=10' \
--header 'app-id: SomeApiKey'
In ...
1
vote
0
answers
103
views
Characters truncated in named credentials custom header parameter
ConnectApi.ExternalCredential externalCred = ConnectApi.NamedCredentials.getExternalCredential('SN_JWT');
System.debug('externalCred :'+externalCred);
when I run this code in salesforce ... in system....
1
vote
1
answer
321
views
Create Named Credential with authentication and user id in url parameters
I have an endpoint with the following format:
https://test.com/api?salesforce=123&agent=123
Do Named Credentials allow me to store the salesforce value in the Named Credentials associated External ...
3
votes
0
answers
839
views
External Credential: Custom Headers not Working (in OAuth Client Credentials/Secret Flow )
I have an external system that exposes an API with 2 endpoints:
Token endpoint: Receives an Id + a Secret in the Authorization header, and a custom value in the user-agent header, and returns an ...
2
votes
2
answers
225
views
External Credential for Amazon - SignatureDoesNotMatch
I'm trying to updload files from SF to S3 using an External Credential.
My user has permissions to access the External Credential, User Credentials, and the Named Prinicipal.
I have confirmed that the ...
0
votes
0
answers
198
views
AWS S3: generating a pre-signed URL
I am trying to generate an AWS S3 pre-signed from Salesforce apex to use later to download file in lwc, see following sample code:
HttpRequest request = new HttpRequest();
request.setMethod('GET');
//...
0
votes
0
answers
26
views
Execute Sync report api not giving correct result
We are using named credentials to call execute sync api(POST) call (https://developer.salesforce.com/docs/atlas.en-us.api_analytics.meta/api_analytics/sforce_analytics_rest_api_getreportrundata.htm). ...
0
votes
0
answers
46
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 ...
0
votes
0
answers
54
views
Named Credentials I couldn't pass API key to Apex ==> Authentication Protocol Custom ==> Principals *Name = apiKey *Value=********* [duplicate]
public class WeatherDetailsClass {
@AuraEnabled
public static WeatherDetailsWrapper getWeatherDetails(String cityName) {
// Frame the Endpoint URL
String apiKey = '*************...
0
votes
1
answer
133
views
Using Session_Id in Manage Package?
We have a managed package that connects with an external system. As a manual step, we ask users to manually create an auth provider and named credentials.
As part of the new release using ConnectApi ...