Stack Exchange Network

Stack Exchange network consists of 174 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.

2
votes
0answers
65 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 ...
1
vote
0answers
21 views

External Services flow parameter null

I am trying to use an External Service to make an API call with a flow, and have configured a Named Credential, an External Service with swagger schema, and a flow with the resulting apex action, as ...
0
votes
1answer
35 views

How is named credentials & auth provider with connected app used? Can i have scenario where it is needed?

I have seen people use auth. providers that has client secret and id of connected app and authenticated using named credentials. The named credentials stores the oauth refresh token but I am not ...
0
votes
1answer
17 views

Storing Credentials - Regharding appExchange product

We are developing AppExchange product where we need to communicate with different third party systems.For Instance , we are getting services from 5 different third party system,a user can have 5 ...
2
votes
1answer
75 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'...
1
vote
0answers
37 views

How can I update a User Record from a custom AuthProviderPlugin's getUserInfo() method?

I am trying to integrate Salesforce with Jira using a Named Credential and oAuth 2.0. The Named Credential requires a Custom Auth. Provider which requires an AuthProviderPluginClass. The ...
0
votes
0answers
43 views

Using Okta SSO and Auth Provider with Named Credentials

I've got Okta SSO and a Auth Provider that generate tokens which works pretty well, except that after 1 hour the tokens start to expire. Rather than adding additional app logic to manage token refresh ...
0
votes
1answer
39 views

Can we use Named Credentials with this Weird API?

In order to do something, we need to make call outs to an external server where the URL takes the format: http://www.example.com/path/{external_id}/doSomething?api-key={api-key} The external-id ...
5
votes
0answers
205 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 /> * @...
3
votes
1answer
93 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>...
0
votes
1answer
53 views

Named Credentials and/or You have uncommitted work pending. Please commit or rollback before calling out

Process_data is called via trigger. This code is working with the exception of when I do the actuall http callout I get the Please commit or rollback before callout out. Based on similar post the ...
4
votes
1answer
507 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 ...
2
votes
0answers
32 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 ...
10
votes
2answers
873 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 ...
0
votes
1answer
43 views

NamedCredential Update using Apex after Sandbox Refresh to avoid PROD reference

My Requirement is to update Endpoint and give (X) in password after sandbox refresh to avoid PROD reference. I am Okay if only Endpoints can be updated. Tried below Snippets and running this from ...
9
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: ...
2
votes
1answer
375 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 ...
1
vote
1answer
276 views

Named credentials for the same salesforce Org using Oauth - not working

Basically I want to use the UI-API to get dependent picklist values to use in custom lightning page. To access the ui-api, I need to make rest callout from apex. So I created a connected App and Auth ...
2
votes
1answer
345 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
0answers
240 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 ...
0
votes
1answer
317 views

Getting URL from a named credential

Is there a way to get a named credential URL into a variable in apex? It looks like the named credential path only works for the setEndpoint method.
5
votes
1answer
124 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 ...
2
votes
1answer
92 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 ...
4
votes
1answer
183 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
8
votes
0answers
603 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 ...
1
vote
0answers
159 views

Where I can store access and secret keys for callouts to AWS SQS service? Should I use Named Credentials or other means suit better for this case

This question has an answer to how to send request to Amazon SQS service from Apex. However, I am concerned that we have to expose access and secret keys in the code. Is this possible to use Named ...
1
vote
1answer
332 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 ...
1
vote
0answers
49 views

How to delivery Salesforce API access in Managed Package when using Lightning Component

Trying to build managed package that can analyze metadata configuration, flow specifically. Building as Lightning Component. Looking for a solution to delivery a Named Credential capable of accessing ...
3
votes
1answer
288 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 ...
0
votes
1answer
121 views

With Named Credentials, why should you ever use remote sites?

With Named Credentials, do I in fact have the ability to make callouts to external systems which do not require autentication? If that is the case, why should I ever use remote sites?
0
votes
0answers
212 views

Named Credentials with Password Authentication not working

I'm using Named Credentials to integrate with Docusign Application using Rest API call. I have granted access to the profile that uses Named Credential as well. But the URL in the Named ...
2
votes
1answer
348 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
1answer
550 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: ...
11
votes
1answer
1k 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 ...
3
votes
2answers
1k 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. ...
1
vote
1answer
356 views

Named Credential - determining if Named Principal is authenticated?

I'm using Named Credentials to support a Scheduled Apex job that needs to call into the Salesforce REST API. The Named Credential is of type Named Principal, using Oauth, and it works just fine. Here'...
9
votes
1answer
436 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({ ...
1
vote
2answers
2k views

UserName and Password in Request body of apex callout using Named Credentials

I am able to make an apex callout by passing the username and password in the request body. String endpoint='https://xyz...com/'; String userID='xyz'; String password='pass'; String jsonBody ='userID=...
1
vote
1answer
714 views

Accessing Apex rest class with OAuth 2.0 with Named Credential authentication mechanism

I have been trying to implement Oauth 2.0 in my org and my requirement is to use Named credentials only when making a apex callout. I am using Named credentials, Oauth, Connected Apps and auth. ...
1
vote
1answer
2k views

Using Named Credentials with OAuth 2.0 username & Password Authentication

I created a new connected apps and obtained the Client secret and Id. I am trying to make a login call to another Salesforce org to obtain the access token. Below approach was successful: String ...
0
votes
0answers
179 views

Named Credential : Pass username and password in url [duplicate]

I am new to using Named Credentials. I created a Named Credential with following details: Identity Type: Name Credential Authentication Protocol: Password Authentication and added username and ...
2
votes
0answers
345 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 ...
0
votes
2answers
629 views

How to specify the path name in Named Credential

I have created Named Credential for a SharePoint Site successfully. I am trying to call the Named Credential with path specified through Apex. I am having trouble in specifying the path name. For ...
3
votes
2answers
249 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 ...
9
votes
1answer
404 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()...
6
votes
1answer
643 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. ...
0
votes
0answers
93 views

Using NamedCredentials to getSessionId

Im trying to deploy components from one salesforce org to another salesforce org in LightningComponent using named credentials and connected apps to establish the connection.But I am unable to ...
0
votes
1answer
248 views

Session expired or invalid“,”errorCode“:”INVALID_SESSION_ID in Named Credentials

public class getContactUsingRESTAPI { public static list<Contact> callgetContact (String accId) { // Create Rest Request http ...
15
votes
2answers
2k 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 ...
4
votes
1answer
827 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:...