Questions tagged [namedcredentials]
The namedcredentials tag has no usage guidance.
355 questions
1
vote
1
answer
822
views
AWS Named Credential in Salesforce Error (Endpoint needs to be in full URL form)
I have an AWS account and two Orgs. I want to link an AWS account to Salesforce with Named Credentials. One Org is of 240 branch and the other is a Sandbox Org that is owned by a customer. I used the '...
1
vote
0
answers
164
views
"Nested" Named Credential Callout
I have a named credential, let's call it NC1, setup for a custom AWS endpoint. This works great using the endpoint and an access key. However, as part of the body of NC1, I need to send an auth ...
1
vote
0
answers
2k
views
Named Credentials with JWT Token Exchange: problem with "subject_token"
I was trying to setup a Named Credentials with JWT Token Exchange (i.e. not the basic "JWT" option) to use GCP Identity Federation and I got this error when doing an APEX Http callout:
...
5
votes
1
answer
606
views
External Service in a Managed Package Doesn't Work in Subscriber Orgs
I'm developing an api integration feature from Salesforce to an external web service in a managed package using External Service, Named Credential and Flow.
The feature works in a packaging org but ...
0
votes
1
answer
1k
views
Using username and password properties from named credentials to create an access token for x-authorization header
I'm using named credentials to make a callout, I'm not using the Generate Authorization Header since the authorization uses an x-authentication header.
I have tried this:
aeroplanCallout....
1
vote
1
answer
2k
views
Named Credential with OAuth Authentication Provider does not refresh access token
This is an extremely annoying unsolved issue that I see more people than I have been, and are(?), struggling with without a solution to date. Please help! Workaround or guidance.
Auth Provider (AP): ...
1
vote
0
answers
749
views
Is There Workaround for Using a Bearer Token as Authentication for Declarative Named Credential?
My OpenApi 3.0 schema requires just a bearer token as authentication. Salesforce declarative Named Credential does not offer this as option. When using Password Authentication with a dummy username I ...
2
votes
3
answers
2k
views
Named Credential - using a merge field
Im facing issues trying to generate the auth header in Apex when using Named Credentials.
Unfortunately I cannot use the standard Named Credential approach (auto header generation) as I have to embed ...
2
votes
1
answer
3k
views
How to debug Named Credential Refresh Token Issue
I am implementing an integration with a third party that uses OAuth 2. I am using a 'Named Principal' Named Credential with an Open ID Connect Auth Provider. It works fine to authenticate and make ...
0
votes
3
answers
964
views
Import Mulesoft APIs with External Services - 301 Moved Permanently Response
I have been following the instructions provided in the official salesforce developer docs here regarding importing mulesoft apis using sfdc external services for use in a flow. I have followed the ...
1
vote
1
answer
6k
views
Named Credential Permission Error - How to enable named credentials with "Named Principal"
I've got a new named credential setup using an OIDC auth provider and the named principal type. It's authenticated successfully but when I try to call it I get
String namedCredential = 'callout:asdf';
...
0
votes
0
answers
669
views
Calling an API hosted by MS Azure
On the Azure Portal console we have registered an application through the App Registration page.
The app has a client credential with 1 secret.
We have created a custom scope, called custom.scope.
We ...
1
vote
2
answers
5k
views
Named credentials are not able to see in profile
I need to add a named credential for one of the profile .But after i look into profile named credential access I can't see any available name credential in org at profile, I navigate Profile==>...
1
vote
0
answers
252
views
Named Credential Invalid Hostname
I am trying to use named credentials as one of my endpoints has an underscore but I am running into this error:
FATAL_ERROR System.CalloutException: Invalid characters in hostname
Here is my actual ...
0
votes
1
answer
885
views
HttpCallout.InvalidNamedCredentialException: Named Credential: xxx not configured in Salesforce
I'm testing an Apex callout using Named Credentials and getting this error
HttpCallout.InvalidNamedCredentialException:
Named Credential: hipaaorder_staging not configured in Salesforce
But the ...
0
votes
1
answer
2k
views
Callout using External Services: Error 401: Unauthorized
The scenario is that want to send a simple JSON-message to a URI without any authentication. I want to achieve this without using code, so I am trying to use a combination of named credentials, ...
1
vote
0
answers
1k
views
Setup the Name Credential and Auth Provider for Marketing Cloud API
We are intent to use Marketing Cloud API using Apex Callout.
Initially, I was trying to set up a Name Credential and Auth Provider for the Server-Server API Package on the MC side.
But with my testing,...
0
votes
0
answers
555
views
named credentials merge fields
So I implemented a custom Auth for Client Credentials flow using example from "https://lekkimworld.com/2021/05/07/custom-salesforce-auth-provider-for-microsoft-azure-client_credentials-flow" ...
1
vote
1
answer
4k
views
Apex callout Unable to tunnel through proxy. 403 forbidden. Using Named Credentials; works fine in curl
Given:
Apex Callout (POST) to an in-house REST service
Named credentials
Authorization headers are correct
URL is correct
Verified working using curl
When:
Invoked using execute anonymous or ...
1
vote
1
answer
219
views
Salesforce Connect OData v4 needs a cookie from /Login endpoint before talking to data endpoints
Here's a rundown of my Salesforce Connect setup:
FIRST I was able to set up a Named Credential, using password authentication
API Name: MyAPI
URL: https://myapi:50000/b1/v2
SECOND I then created an ...
0
votes
0
answers
2k
views
How to use Named Credentials in a Basic Auth callout with API key?
This initial code works perfectly to do a Callout with UN, PW and API key in Custom Settings.
But this is less secure and so I want to move teh UN & PW to Named Credentials.
but it fails.
This ...
0
votes
2
answers
2k
views
Importing certificates: "Keystore contains a certificate with an alias that conflicts with a certificate already in the organization."
I'm trying to deploy changes that include Named Credentials from one sandbox to another. In order to do that, all the certificates used by my Named Credentials need to be in the target sandbox at the ...
2
votes
1
answer
882
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 ...
0
votes
1
answer
513
views
Salesforce BOX integration with Named Credentials
I am actually trying to use Named Credentials with Auth provider to connect Box API, however when I am trying to authenticate with the box I am stuck. It is taking me to the Salesforce page instead of ...
2
votes
0
answers
1k
views
Salesforce Marketing cloud rest API from Salesforce Cloud (apex)
I'm trying do set Auth. Providers and Named Credential for the salesforce marketing cloud in order to be able to make callout from apex without worrying to get and refresh the token.
Is there any ...
0
votes
1
answer
1k
views
Custom auth provider - how to get a new access token without a refresh token
I have to integrate Salesforce with an external app using OAuth2.0.
I create Auth. Provider and Named Credential, authenticated successfully too.
But I'm getting one issue with Named Credential :
The ...
5
votes
0
answers
306
views
Merging fields into Named Credentials for use with External Services and Flow
I have an external REST API with an OpenAPI definition that I'd like to call from Salesforce via External Services + Flow. The external REST service needs a lot of extra stuff in the header for ...
-1
votes
1
answer
1k
views
Move files from one folder to another using Google Drive API and Apex [closed]
I’m making a callout using named credentials and trying to update the parent Id of the G-Drive file. While doing the callout, getting the below error.
"error": { "errors": [ {...
0
votes
0
answers
583
views
Named Credentials with Authorization Protocol OAuth 2.0 vs authorization and authentication handled using apex
Could anyone please clarify my doubts. If I use Authentication Protocol as Oauth 2.0 and provide an Authentication Provider for the same with required settings and call a rest end point of different ...
2
votes
1
answer
3k
views
How do you you use Named Credentials in LWC?
How do you use named credentials where a LWC makes the callout?
I have an apex controller where I'm getting the path and the user creds and passing it to LWC, and getting the error below in Chrome:
...
0
votes
1
answer
799
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 ...
0
votes
2
answers
2k
views
Named Credentials using password authentication
I need to call the same org using named credential password authentication,. Can anyone explain if i need to pass a api for the password where could I get that api for same salesforce org?
2
votes
0
answers
240
views
Force Named Credential to get a new access token using Apex
I'm using a Named Credential with OAuth2 to call a SOAP API. This API returns an HTTP 500 after the token is expired, but a Named Credential can only automatically refresh the access token when a 401 ...
1
vote
1
answer
361
views
How to add nonce & state to OpenID based Named Credential
I'm working on an integration using a named credential with an OpenID auth. provider. I'm getting a nonce_is_missing response when running the authentication flow (during save of the named credential)....
2
votes
1
answer
1k
views
Payment Gateway Authentication
I am trying to setup B2B Commerce Payments to use a Cyber Source Payment Gateway that I have already implemented but am having issues with the authentication.
The Cyber Source API that my Payment ...
1
vote
0
answers
185
views
How can i create ExternalDataUserAuth for Google integration
I have created Named credentials with Identity type per User and OAuth 2.0 Protocol. Everything works fine if I go step by step in the Settings -> Authentication Settings for External Systems -> ...
0
votes
2
answers
1k
views
Best Practices for Storing API Key?
I have a Lightning Web Component that makes a fetch() request straight from the component's JavaScript. For testing and development I've simply stored the API key as a variable, but I'd like to back ...
0
votes
0
answers
26
views
Named credential now working when deployed to production org via package [duplicate]
When testing in the scratch org environments everything goes fine, but after creating a package and installing it in a environment that is close to production, callouts are not working, and the ...
0
votes
1
answer
901
views
Calling Tooling API via Named Credential and refresh tokens
I am using Named Credential to call Tooling API.
I'm seeing this warning on Named Credential and keep losing access to it. Keep getting Invalid Session Id error every few hours.
"The ...
0
votes
0
answers
788
views
How to set up Named Credentials for NiCE inContact Central API?
As the title says, I'm trying to figure out how to set up a Named Credential for the inContact API. I've been searching for specific documentation or examples, but no luck yet.
I've currently got the ...
3
votes
1
answer
3k
views
oAuth: implementing Client Credentials flow for calling out to a 3rd party API
GOAL: Retrieve an access token from a 3rd party service so as to make a call with this token to 3rd party API. This is the quote from the doc.
The ExternalApp API is accessible using an Oauth2 JWT ...
4
votes
1
answer
8k
views
Should Named Credentials be used to store an API Callout Bearer Token?
Problem
I have a straightforward REST API callout in apex.
request.setEndpoint('https://api.websitename.com');
request.setMethod('GET');
request.setHeader('Authorization','Bearer ...
1
vote
1
answer
682
views
Basic GET request not working with name credential
I have a GET request I want to manage but Authorization Header is not working if I retrieve username and password from Named Credential.
String username = '{!$Credential.UserName}';
String password = '...
1
vote
0
answers
196
views
Setting up Auth Provider with SSO
I am calling a REST API using Auth provider and Named credential, but the client wants to use their IDP SSO instead of using API credentials. Is there a way we can configure an SSO with Auth Provider ...
2
votes
1
answer
745
views
How to find out 'Authentication Status' of specific Named Credential for current user?
Is there any way we can query for and check the Authentication Status of a Named Credential for the current logged in user?
I found we can query for Named Credential sObject, as well as ...
2
votes
1
answer
907
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 ...
1
vote
1
answer
1k
views
Error 404 when using named credentials
I am actually using named credentials to do a callout to another salesforce instance. The following code works well in my sandbox :
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:...
3
votes
1
answer
383
views
How to use Named credentials with a 2 step password and access token authentication system?
The third party system that I am trying to connect to has following authentication mechanism:
Step 1: We have been provided with a X-Api-User and X-Api-Secret to be included in header.
Other header ...
5
votes
0
answers
92
views
Identity Hash failure when getting keyId [closed]
I'm receiving this error below, but it starts coincidentally after applying the update Summer'21.
IdentityHash failure when getting keyId: 02G1H0000005AOD of type CREDENTIAL for Context Org: ...
0
votes
1
answer
2k
views
System.CalloutException: The URI is invalid
I'm doing a simple HTTP callout in Apex using a Named Credential with Username/Password authentication, but I'm getting a System.CalloutException: The URI is invalid.
What could be the cause here?
...