Questions tagged [namedcredentials]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
20
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 ...
12
votes
1answer
3k 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
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 ...
11
votes
2answers
169 views

How to trigger Authentification of Named Credential created via Apex

I use the Metadata API and the Apex wrapper to create an AuthProvider and NamedCredential after the installation of my managed package app. MetadataService.NamedCredential cred = new MetadataService....
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
1answer
559 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({ ...
10
votes
1answer
119 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 ...
10
votes
0answers
1k 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 ...
9
votes
2answers
4k 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 ...
9
votes
1answer
716 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-...
7
votes
1answer
2k 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
2k 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
766 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
354 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
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
1k 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
1k 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 ...
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
2answers
440 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 ...
5
votes
1answer
213 views

AWS Signature Version 4 Using Named Credentials

Anyone tried Summer '19 Named Credentials using AWS Signature Version 4 successfully? Trying again to use External Services and first step is the Credentials. I created an IAM user with the ...
5
votes
0answers
362 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
201 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
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
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-...
4
votes
0answers
62 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 ...
4
votes
1answer
463 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
314 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
234 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
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/...
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
735 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
235 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
275 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
43 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-...
3
votes
1answer
62 views

Using Named Credentials in OAuth 2 authentication (grant_type=password)

I want to get an access token from an external endpoint (HTTP callout to REST API) without hardcoding passwords. The external system expects a request with Oauth 2.0 authentication details provided in ...
3
votes
1answer
106 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
82 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 ...
3
votes
2answers
111 views

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

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
551 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
344 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
409 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
143 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
574 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
114 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
531 views

Custom settings and NamedCredentials update after sandbox refresh

I have some Custom Settings and Named credentials configured since I make call outs to external systems. But every time I refresh any of my sandbox, I have to manually update the Custom Settings and ...
2
votes
2answers
28 views

How can i mass update NamedCredentials?

I need to update endpoint for 50 records on NamedCredential object. I tried different scenarios but nothing seems to be working.. 1 - Endpoint is not allowed to filter in SOQL and NamedCredential is ...
2
votes
1answer
255 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 ...