Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [namedcredentials]

The tag has no usage guidance.

19
votes
2answers
3k views

Where to Store Token Auth?

Problem Statement I am working on an integration that will authenticate with a token. I need to pass it via header as follows: "Authorization": "Token abcdefghijklmnopqrstuvwxyz" I also need to ...
11
votes
1answer
2k views

Use a Named Credential with API key?

I want to be able to make callouts to JotForm, but they do not support OAuth and username/password is insufficient for their API. Here are their docs; for reference, here are the 3 auth options: ...
11
votes
1answer
2k views

Using Named Credentials and Auth Provider to manage security token for APEX Callout to an OAuth 2.0 REST API

I'm trying to do an APEX Callout to a OAuth 2.0 secured REST API This is the API https://developers.pandadoc.com/v1/reference#authentication-process I want to use something to manage the security ...
10
votes
2answers
1k views

session is not valid for use with the REST API

I have http request batch class with the endpoint url is set by using Named Credential in apex code Named Credential: Given as My Domain URL Identity type as Named Principal Authentication Protocol ...
10
votes
1answer
489 views

Named Credentials in Lightning Component - Streaming API

Setup: Force.com site page Guest Users VF with Lightning Out Lightning component to subscribe to Push Topic Problem Guest User does not have a session ID so no way to set it here: $.cometd.init({ ...
9
votes
1answer
545 views

Possible to update NamedCredential from Apex?

Question Is it possible to create or update a NamedCredential from within Apex? Investigation I looked into available options, and it seems the SOAP API only supports the describeSObjects(), query()...
9
votes
2answers
1k views

Session expired or invalid

I am trying to build Salesforce to Salesforce integration using Named Credentials. Followed steps from below blog. http://www.jitendrazaa.com/blog/salesforce/salesforce-to-salesforce-integration-...
9
votes
1answer
76 views

Did Summer 19 break NamedCredentials using Auth. Provider in Sandboxes

This weekend some of our sandboxes was upgraded to summer 19. before that we were able to query consumer secret from the Auth. Provider used in the named credentials. After the summer release we are ...
8
votes
2answers
3k views

Use of Named Credentials seem to be tied to External Data Source

I'm looking into using Named Credentials (spring '15) to simplify apex callouts to an external web service. I actually thought, based on the documentation, that this would help, and I'm referring ...
8
votes
0answers
837 views

Including access token in endpoint URL when using named credential in REST callout

I'm trying to retrieve a list of forms using the FormAssembly API via a HTTP Request to the endpoint: https://app.formassembly.com/api_v1/forms/index.json I was able to setup named credentials and ...
7
votes
1answer
1k views

Use Named Credentials with a SOAP WSDL2APEX class

SF allowed the usage of Named Credentials with SOAP callouts but the documentation doesn't really go into details of how to pass/access the Username and Password to the stub.inputHttpHeaders_x . I ...
6
votes
1answer
1k views

Named Credentials in wsdl2apex Class

I have a few questions regarding Named Credentials. I need to perform a SOAP based call out to an external system from Sales Force. I used the wsdl2apex function to generate the class for the call out....
6
votes
1answer
2k views

named credential problem

I am trying to implement named credential in my integration I am getting error below: The callout couldn't access the endpoint. You might not have the required permissions, or the named ...
6
votes
1answer
712 views

Session Id not getting refreshed automatically with Custom Auth provider in Salesforce Named Credentials

Problem statement : The Named Credential created for OAuth 2.0 authentication and Custom Auth provider works until the first session Id which was obtained using the method 'handleCallback' is valid. ...
5
votes
1answer
826 views

Named Credentials and support for the OAuth2 Client Credentials Grant Type and alternatives

I have a requirement to authenticate to an external API for callouts using the OAuth2 Client Credentials Grant (This was helpful in referencing the different grant types for me). I would like to use ...
5
votes
1answer
2k views

Using Named Credentials to get Salesforce sessionId

I have a system that is posting data to a streaming channel which works upon data changing and a trigger firing. The a code snippet is shown below. string sessionId = UserInfo.getSessionId()...
5
votes
1answer
2k views

Mock Testing with Named Credentials

I've successfully implemented Named Credentials for a Basic Auth integration callout. However, when I went to write my test method, I noticed one minor annoyance. When I try to create a ...
5
votes
1answer
1k views

Named Credentials: How to Start OAuth flow?

I'm using Named Credentials with OAuth authentication. When calling a method on the endpoint, my Apex app receives back the status that the token needs to be refreshed. How do I tell Salesforce to ...
5
votes
0answers
295 views

Named credential does not work with client credentials

I have read the full documentation and have few questions on how named credential works. I have written a custom provider like this: /** * Description of the class * <p /><p /> * @...
5
votes
1answer
169 views

Named Credential - Merge fields in managed package

I'm working on a managed package where a requirement, out of our hands, is to authenticate to a SOAP API via WS-Security. I was hoping we'd take the strategy of using Named Credentials. This would ...
4
votes
1answer
250 views

Is it posibble to edit Named Credential url in a managed package?

I need to change the named credential url in the managed package. But it is not possible when we install the package in another org. Is there any possibility to do that? Thanks
4
votes
1answer
949 views

Can I use Named Credential merge fields as URL parameters on the endpoint?

I have a named credential as follows: Name Test_Credential URL https://www.somesite.com Identity Type Named Principal Authentication Protocol Password Authentication Username foobar ...
4
votes
1answer
1k views

Named Credentials - Merge Fields not Resolving

I am having an issue when attempting to reference the {!$Credential.UserName} and {!$Credential.Password} merge fields. I created a named credential with the following configuration: Identity Type:...
4
votes
1answer
349 views

error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration

I am connecting two salesforce orgs with connected app, named credential and Auth Provider. I have created connected app in target sandbox. Created Auth Provider in source org by providing Consumer ...
4
votes
0answers
274 views

Using Named Credentials in Batch Job (multi user)

Named credentials are working good in single user scenario, where we are making callouts on behalf of a given user. In a recent requirement, we need to setup a "PER USER" Named Credential, which ...
4
votes
0answers
209 views

Use of Self-Signed Certificate under Named Credential

Did anyone tried to use Self-Signed Certificate or any other type of certificate with Named Credentials. I am trying to setup Named Credential under destination Salesforce org which will connect with ...
3
votes
2answers
2k views

Where should we store username/password/endpoint…in Salesforce?

We have a web application developed in Salesforce (apex classes/ triggers and visualforce pages). This web application is talking to our APIs externally using endpoint urls with username and password. ...
3
votes
1answer
674 views

Salesforce REST API Named Credential INVALID_SESSION_ID

I am attempting to call the Salesforce REST API from a Lightning Component. As per their documentation I have set up a named credential using the following settings: Label: Salesforce REST Name: ...
3
votes
1answer
164 views

What fields deploy with NamedCredential?

I have a callout where we use a Named Credential and it looks something like the following: public class MyClass { public MyClass() { inputHttpHeaders_x = new Map<String, String>...
3
votes
2answers
261 views

Set OAuthToken Without Apex Metadata Wrapper?

In working through an answer to this question, I found that I can set the oauthToken value on a NamedCredential using an Apex wrapper for the Metadata API. However, as far as I am aware, that still ...
3
votes
1answer
98 views

Auth Provider Insufficient Privileges on the migration tool deployment

I have created a custom Auth Provider and a named credential. I then deployed it to my org as a system administrator. When I tried adding the named credential to User -> Authentication Settings for ...
3
votes
1answer
1k views

Salesforce to Salesforce integration using Named Credentials

I am trying to build Salesforce to Salesforce integration using Named Credentials. Followed the steps from below blog. http://www.jitendrazaa.com/blog/salesforce/salesforce-to-salesforce-integration-...
3
votes
2answers
54 views

How can I trigger the Oauth authentication flow for my apex-created Named Credential?

I am trying to callout to the Salesforce Metadata service (ApexMDAPI) using Named Credentials. Using Named Credentials with the Apex Wrapper My goal is to use this credential with configuration in a ...
3
votes
0answers
42 views

Prevent modifications to Named Credential in Managed Package?

The background of my question is described in Managed package upgrade fails as Named Credential seems to have modified. The upgrade of a managed packaged failed with a modification error on a ...
3
votes
0answers
512 views

Configuring a Named Credential for Oauth 2.0 callouts from Visualforce

I am trying to set up a Named Credential so that I can make callouts from a Visualforce controller to an external web app using Oauth 2.x. The web application is called Procore. I'm not sure how to ...
2
votes
1answer
2k views

Migrating Named Credential with password

I retrieved a Named credential using Ant migration tool and in the xml it looks like this: <?xml version="1.0" encoding="UTF-8"?> <NamedCredential xmlns="http://soap.sforce.com/2006/04/...
2
votes
1answer
207 views

Doesn't a Named Credential handle OAuth2?

Reading this doc from Salesforce, it was my understanding that a named credential handled authenticating when using it to make a callout. I'm going to go out on a limb and say that it probably does, I'...
2
votes
1answer
367 views

NamedCredential soap request authentication headers

I have a WSDL file which can't be imported in Salesforce, so I am currently using the Dom.Document to write my own soap envelope to connect to a webservice. In my soap envelope I have to set ...
2
votes
1answer
53 views

How to access a Per-User Named Credential from Apex

My managed package Apex code is making callouts but I can't use a packaged Named Credential as the user also needs to be able to adjust the endpoint URL not only the username and password. I planned ...
2
votes
1answer
471 views

Is it possible to set per user Named Credentials via Apex?

I need to integrate with an external system that cannot fully support OAuth 2.0 server flow, so we're looking at just doing a basic username/password flow. So, I think I need to set up Named ...
2
votes
1answer
103 views

Store Firebase API Key in Salesforce

I'm looking for Best Practice how to store API Keys like Firebase in Salesforce. Situation For a Salesforce implementation data has to be pushed to Googles Firebase The API Key should not be visible ...
2
votes
1answer
55 views

Canvas app inside managed package that connects to configurable endpoint

Our customers have versions of our Java web app installed in their data center. I want to build a managed packaged Salesforce App that is able to connect to those web app instances using Salesforce ...
2
votes
1answer
94 views

Connect to Salesforce production REST API from Sandbox using Named Credentials

Background I would like to connect to the REST API of a production org, from a sandbox org. Configuration so far: Production Org has a Connected App Sandbox Org has a Auth. Provider Sandbox Org has ...
2
votes
1answer
27 views

Managed package upgrade fails as Named Credential seems to have modified

But the Named Credential hasn't changed between current and new version. So this Known Issue doesn't apply: https://success.salesforce.com/issues_view?id=a1p3A000000mCFtQAM&title=cannot-modify-...
2
votes
0answers
224 views

Refresh Token using Salesforce Named Credentials and Auth Provider

I am performing a rest callout to a 3rd party service. Authentication is set up with a named credential (Named Principal, OAuth2) using an Open ID Connect-authentication provider which uses WSO2 ...
2
votes
0answers
40 views

Setting up Marketing Cloud as an Auth. Provider

Lately we've been integrating very tightly with Marketing Cloud, so I thought about trying to set up the External Services which Salesforce provides in order to do some minor actions via flows. In ...
2
votes
1answer
485 views

Named Credential: Authentication process and refresh token

I've begin working with Named Credential and Authentication Provider for the first time and I'm a bit lost on the authentication process and the refresh token functionalities. I'm going to add to my ...
2
votes
1answer
408 views

Named Credential - Automatic refresh token does not work with WSO2 Identity server

I am facing an issue with the named credential platform functionality in the following integration scenario: The Salesforce Org is supposed to perform Rest callouts to a 3rd party service. ...
2
votes
0answers
390 views

How do you use Named Credentials with a Google Cloud API, which requires a JWT to get a token?

Is it possible to used named credentials with a service account to connect to the Google Cloud Platform? I'm trying to make a client to send Pub/Sub messages to Google Cloud from Apex, and it'd be ...
2
votes
0answers
135 views

How can I leverage Named Credentials?

I am doing a POC for a point to point integration between Salesforce & SAP. I have to make callouts to SAP's SOAP services. The SAP team has provided me a WSDL file, the body block of WSDL expects ...