Questions tagged [namedcredentials]
The namedcredentials tag has no usage guidance.
355 questions
-1
votes
1
answer
357
views
How to create Auth Provider using APEX
I could see AuthProvider Object support Create() and Update(), But when i try to insert its throwing following error.
DML operations are not allowing on Auth. Provider
Code:
AuthProvider authPro = ...
0
votes
0
answers
48
views
How to associate External Data Source with a named credentials?
I created an External Data Source following the steps given in the following link :
https://help.salesforce.com/s/articleView?id=sf.search_define_federated_search.htm&type=5
However the External ...
0
votes
0
answers
205
views
Get Presigned URL using named credentials
I successfully obtained the pre-signed URL to upload large file to aws s3 bucket using the method described in the article https://mtr-design.com/news/how-to-create-a-presigned-url-for-aws-s3-using-...
0
votes
0
answers
77
views
Named Credential / External Credential Only Working Once
I've used a Named Credential with External Credential for the Client Credentials with Client Secret Flow.
I didn't find the documentation very helpful to be honest, but this super post helped me get ...
0
votes
0
answers
81
views
Setup Name Credential with External Credentials
I'm starting developing on Salesforce, and I've to send some data to one of our client api. The client gave some access details to connect to their webapi.
It looks like this :
url POST
https://...
3
votes
1
answer
344
views
External/Named Credential - acquiring access token from Mule via client credentials flow
I want to configure Named&External Credentials with oAuth client credentials flow and use it in apex.
An endpoint is exposed by Mulesoft. I followed those very neat instructions shared here, but I ...
2
votes
0
answers
84
views
Package Named Credentials such that they are editable by subscriber org
I was using legacy named credential till now and used to package a named credential with no authentication type. I used the same in my packaged apex code. Once the package was installed, the customers ...
0
votes
0
answers
90
views
Programatically give a user access to an ExternalCredential Principal (Per User)
I try to find a way to programatically give a user access to an ExternalCredential Principal (Per User).
The standard way, is to go to personal settings and click "Allow Access".
I found out ...
0
votes
0
answers
349
views
We can’t log you in because of the following error. Remote_Error: The remote service returned an error
I have a strange case. I have custom Auth Provider, trying to authorize named credential and getting:
Problem Logging In
We can’t log you in because of the following error. For more information, ...
2
votes
1
answer
130
views
Named Credential not created through SOAP Metadata API
We are connecting Salesforce from a third-party system, the requirement is to create some named credentials, custom metadata records, and remote site settings from the third-party System after ...
1
vote
0
answers
1k
views
Can't find my Named Credential in Permission Set
I'm trying to give access of my Named Credential to a Profile, but I just can't find the Named Credential on the Available Named Credentials in the Permission Set. I already gave the Permission Set ...
1
vote
2
answers
403
views
Creating a Named Credential with Apex
Trying to programmatically create a Named Credential and getting odd errors when trying to run this code:
ConnectApi.ConnectApiException: Provide only the developer name of the external credential.
...
1
vote
0
answers
23
views
2GP post-installation Lightning Tab - set ConnectedApp.oauthConfig.isAdminApproved to true and assign profiles
For a 2GP, putting together a UI for System Administrators to manually navigate to after installation to automate post-installation configuration.
Here's the part I am working on...
Sets ConnectedApp....
0
votes
0
answers
36
views
Flosum-Jira connector : Named Credentials errored out while accessing
I am working on Flosum expert level certificate, where we integrate Jira with Flosum with Flosum Jira connector and using named credentials.
How ever its popping an error while trying to config new ...
2
votes
1
answer
871
views
Named Credentials in Managed Package Apex Callout
I am trying to create a managed package that has a callout to a webhook. Very simple use case, when opportunities or accounts change we want our server to be notified.
I have setup some Apex triggers ...
0
votes
0
answers
55
views
How to call salesforce service end point as current user while using Named credentials as LWC is the invoker based on user action
What is the best way to call salesforce service end point as current user. As Named credential authenticates as one specific user who initially authorizes it.
I am calling my apex helper method from ...
1
vote
1
answer
935
views
Named Credential - Status: Unauthorized; Status Code = 401 - Working with Bearer Token but not with Callout
I have a Legacy Named Credential from UAT that I am porting over to PROD. To test the Named Credential, I am running an Apex Snippet in PROD but I am getting a 401 error. See below:
However, when I ...
0
votes
1
answer
330
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 ...
1
vote
1
answer
474
views
Calling AWS Simple Email Service from Apex
I have been trying to integrate the Amazon SES API into my Salesforce project so I can setup a scheduled batch job to send bulk emails.
I've created this class to create a signed request to the SES ...
1
vote
0
answers
66
views
Named Credential for WebSocket
I have a requirement to make POST callouts to an endpoint allocated inside a WebSocket and I want when trying to configure the Named Credential it gives me the following error:
Endpoint needs to be in ...
1
vote
1
answer
157
views
http call out to an external REST webservice
Simple use case -
make a http call out to an external REST webservice. Parse the JSON response.
I know I could do this using Flow, but due to the business requirement have opted for Apex Class.
Can ...
1
vote
0
answers
466
views
How to properly write custom header formula in External Credential?
I need to make callout to the Hotel Beds api. For an authentication headers I used External Credentials custom headers.
But it is not properly creates headers(I guess).
Hotel Beds requires following:
...
6
votes
2
answers
278
views
Using per subscriber callout from managed package
I'm creating a managed package that includes a callout to a custom REST API endpoint. Based on this conversation thread, it appears that the "new" External Credentials are not supported for ...
1
vote
0
answers
411
views
Dynamically selecting external credentials with Named Credentials
We have a button that integrates with an external system using Named Credentials. We are using per-user authentication here and every user authenticates themselves with their external system username ...
0
votes
0
answers
850
views
External Credentials not making oauth call
I am attempting to implement the Named Credential/External Credential system following this post and am getting "System.CalloutException: Unable to fetch the OAuth token." error. Everything ...
1
vote
0
answers
257
views
External Credential Flow (Existing_link)
Struggeling to Authenticate to Microsoft AD With Open ID Connect using Named Credentials/External Credentials.
First of all: This approach works on all Salesforce Instances, now I have this issue on a ...
0
votes
0
answers
263
views
Named Credential Principal Data Disappeared
I have a named Credential that has worked for months. I see in my logs that the integration successfully updated a record on 6 days ago, but today it failed due to a missing credential in Setup. I ...
0
votes
0
answers
450
views
Named Credential with Basic Authorization Token, Username and Password details
I am trying to callout to an external application APIs to fetch data into Salesforce.
That external application has Auth token URL which will need below details to share Access token (bearer) to be ...
0
votes
1
answer
563
views
Apex Callout - Use Named Credential Password Placeholder in setEndpoint [duplicate]
I've created an Apex class to call a custom rest api endpoint for a Snowflake database.
The call is pretty basic in that you just include the token and a query in the endpoint Url.
I would like to use ...
2
votes
0
answers
160
views
How to use a Named Credential within an Auth. Provider Plugin?
I'm currently working on an Apex Auth Provider Plugin, and I've encountered a PMD code scan error with the following message:
Suggest named credentials for authentication. Rule: Security-...
0
votes
1
answer
2k
views
Callout failed for invocable action
I'm trying to set up a FLOW with an HTTP Callout "GET" request and I'm getting the below exception.
Info
Error Occurred:
Callout failed for invocable action
GetProspectLinkedinSearchTest....
0
votes
0
answers
184
views
Callout named credential calls with a blob body
I am trying to launch a callout call to an OCR from an Apex method using a secured named credential with an external credential.
The HTTP request is a POST request with multipart body containing a ...
0
votes
0
answers
442
views
OAuth Client Credentials flow for external services - token expiration
I'm trying to connect to Marketo REST API via an external service leveraged in a flow, using the client credentials external credential and a named credential. Here is Marketo's doc on authentication
...
1
vote
1
answer
838
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 ...
0
votes
1
answer
2k
views
OAuth 2.0 in External Credential
This is a question about using OAuth 2.0 protocol with Salesforce's Named and External Credentials.
I created an External Credential with OAuth, Client/Secret, and token ID URL. I created the ...
1
vote
0
answers
415
views
ConnectApi.NamedCredentials.deleteCredential not doing anything
I am working with the ConnectApi namespace NamedCredentials class to create and delete Named/External credentials programatically.
Creation was easy enough but now I am struggling to delete. I am ...
1
vote
0
answers
815
views
Salesforce Named Credentials - oauth token refresh does not work
I am using Named Credentials to make callouts to a sharepoint system.
Initially, callouts from apex code work fine, until the token expires after 12 hrs. Then I am consistently receiving below error:
...
0
votes
0
answers
118
views
Trouble using HTTP callout action in Flows with AWS Signature Version 4
I'm trying to make a very simple AWS API call out using an HTTP callout (POST request) in salesforce but I have been getting the following error.
{"__type":"InvalidSignatureException&...
14
votes
1
answer
7k
views
External + Named Credential with oAuth client credentials flow
Given: a REST API that requires authorization. The authorization service attached to the API supports oAuth, one of the available oAuth flows is Client Credentials (grant_type=client_credentials)
How ...
0
votes
1
answer
504
views
Named Credentials access issue to customer Portal user
Named credentials developed for a Customer Portal working fine for Admins,
but where as the customer portal users have access issues even after
adding the User to the Permission set and
adding the ...
1
vote
1
answer
314
views
External named Credential is not able to fetch in Apex code for Winter 24 Pre
Created the External Named credential with name Samsung Test
Added the Principal
Added the permission set
However I am not able to fetch this named credential in Apex code.
HttpRequest req = new ...
1
vote
1
answer
470
views
Invocable Method to return External Service data type
Ideally, we will create an External Service based on the API Schema and use it in Flows.
For some reason, when we do callouts in the Flow, the API cannot parse the Authorization header correctly, ...
0
votes
0
answers
336
views
Salesforce Named Credential HMAC merge function \n new line not work in value
I am trying to make an api integration using named credential with custom provider, making use of the merge function BASE64ENCODE HMAC for a signing value
in summary, I am not getting the same value ...
-1
votes
2
answers
825
views
Named Credentials of type custom for authorization [duplicate]
We have the following logic implemented to get the access Token and we want this to be implemented using the Named credentials
Http http = new Http();
HttpRequest request = new HttpRequest();
req....
2
votes
1
answer
2k
views
External Credential - merge parameters in callout body
So I have created a secure endpoint named credential with an external credential. The external credential has 1 principal with two properties, client_id and client_secret. Now I can't find any way to ...
1
vote
0
answers
385
views
Rotating External Credential Principal
I am looking to call an external API from Salesforce using AWS Signature v4. The external API is using AWS API Gateway with IAM authorization enabled. I have created an access key for an IAM user and ...
0
votes
0
answers
109
views
OAuth Token Authentication Issue
Named Credentials is setup for "ABC" and same details we are storing in ABC_Metadata__mdt.
Auth. Provider is setup for "ABC" and same details we are storing in ...
2
votes
1
answer
763
views
Callout via Named Credentials with client credentials oAuth flow
I'm trying to set up an external service that will rely on REST API calls from Salesforce to Marketo, which relies on client credentials OAuth 2.0 to authenticate. To authenticate with the Marketo API,...
1
vote
0
answers
290
views
How to Configure Named Credentials in Salesforce for External Callouts Using Client ID and Client Secret?
I'm in the process of integrating Salesforce with an external service. In our scenario, an LWC page calls a method in its Apex controller. This method then initiates an external callout to obtain a ...
1
vote
2
answers
251
views
Store settings and API credentials in packaged CMDT records
My current Managed Package supports a single GPT API and covers that with multiple packaged components:
Protected Custom Setting for secure storage of API credentials (Named Creds don't work)
Custom ...